class CurriculumLevel(models.Model):
title = models.CharField(max_length=16, db_index=True)
+ verbose = models.CharField(max_length=32)
class Meta:
verbose_name = _("curriculum level")
assert m is not None, "Curriculum identifier doesn't match template."
level, created = CurriculumLevel.objects.get_or_create(
title=m.group('level'))
+ if created:
+ print 'created level:', m.group('level')
def_title = m.group('course').capitalize()
course, created = CurriculumCourse.objects.get_or_create(
slug=slugify(m.group('course')),
'title': def_title,
'accusative': def_title,
})
+ if created:
+ print 'created course:', slugify(m.group('course')), def_title
type_ = m.group('type')
if m.group('roz'):
title += " (zakres rozszerzony)"
{% if currset %}
{% for what, types in currset.items %}
<li>
- {{ what.0 }}, {{ what.1 }} {% if new %}klasa{% else %}poziom edukacyjny{% endif %}<br/>
+ {{ what.0 }}, {{ what.1 }}<br/>
{% for type, currs in types.items %}
{{ type }}:<br>
{% for curr in currs %}
currset = SortedDict()
for curr in currs:
- k = curr.course, curr.level
+ k = curr.course, curr.level.verbose
if k not in currset:
currset[k] = SortedDict()
typename = Curriculum.TYPES[curr.type]