X-Git-Url: https://git.mdrn.pl/edumed.git/blobdiff_plain/bab0a9769a853e7b7d6368e293838be1bef4a8f6..f2dd9c713605ba2a17425267eb2c0c4b4f7dc928:/curriculum/models.py?ds=sidebyside diff --git a/curriculum/models.py b/curriculum/models.py index 3a069dd..0c3acb2 100644 --- a/curriculum/models.py +++ b/curriculum/models.py @@ -166,6 +166,7 @@ add_translatable(CompetenceLevel, { 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") @@ -214,6 +215,8 @@ class Curriculum(models.Model): 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')), @@ -221,6 +224,8 @@ class Curriculum(models.Model): '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)"