fnp
/
edumed.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add project lesson template.
[edumed.git]
/
catalogue
/
management
/
commands
/
repackage.py
diff --git
a/catalogue/management/commands/repackage.py
b/catalogue/management/commands/repackage.py
index
e6de171
..
eed8576
100755
(executable)
--- a/
catalogue/management/commands/repackage.py
+++ b/
catalogue/management/commands/repackage.py
@@
-23,19
+23,28
@@
class Command(BaseCommand):
for si, section in enumerate(Section.objects.all()):
li = 1
for si, section in enumerate(Section.objects.all()):
li = 1
+ li_adv = 1
for lesson in section.lesson_set.all():
for lesson in section.lesson_set.all():
+ advanced = lesson.level.slug == "liceum"
+ section_dir = "%d_%s%s" % (
+ si + 1, section.slug,
+ " (zaawansowane)" if advanced else "")
if lesson.type == 'course':
if lesson.type == 'course':
- prefix = "%d_%s/%02d_%s/" % (
- si, section.slug,
- li, lesson.slug,
+ if advanced:
+ ind = li_adv
+ li_adv += 1
+ else:
+ ind = li
+ li += 1
+ prefix = "%s/%02d_%s/" % (
+ section_dir, ind, lesson.slug,
)
)
- li += 1
elif lesson.type == 'synthetic':
elif lesson.type == 'synthetic':
- prefix = "%
d_%s/synteza_%s
/" % (
- s
i, section.slug
, lesson.slug)
+ prefix = "%
s/%s (synteza)
/" % (
+ s
ection_dir
, lesson.slug)
else:
else:
- prefix = "%
d_%
s/%s/" % (
- s
i, section.slug
, lesson.slug)
+ prefix = "%s/%s/" % (
+ s
ection_dir
, lesson.slug)
lesson.add_to_zip(zipf, student, prefix)
zipf.close()
lesson.add_to_zip(zipf, student, prefix)
zipf.close()