1 # -*- coding: utf-8 -*-
2 from south.utils import datetime_utils as datetime
3 from south.db import db
4 from south.v2 import DataMigration
5 from django.db import models
8 KLASA = ['I-III', 'IV-VI', 'VII-VIII', 'IV-VIII']
9 POZIOM = ['O', 'I', 'II', 'III', 'IV']
11 'LO': 'liceum i technikum',
15 class Migration(DataMigration):
17 def forwards(self, orm):
18 for level in orm.CurriculumLevel.objects.all():
19 if level.title in KLASA:
20 level.verbose = '%s klasa' % level.title
21 elif level.title in POZIOM:
22 level.verbose = '%s poziom edukacyjny' % level.title
23 elif level.title in OTHER:
24 level.verbose = OTHER[level.title]
26 raise ValueError('Unknown level')
29 def backwards(self, orm):
33 u'curriculum.competence': {
34 'Meta': {'ordering': "['section', 'order']", 'object_name': 'Competence'},
35 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
36 'name_en': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '255'}),
37 'name_pl': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '255'}),
38 'order': ('django.db.models.fields.IntegerField', [], {}),
39 'section': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['curriculum.Section']"}),
40 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '50'})
42 u'curriculum.competencelevel': {
43 'Meta': {'ordering': "['competence', 'level']", 'object_name': 'CompetenceLevel'},
44 'competence': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['curriculum.Competence']"}),
45 'description_en': ('django.db.models.fields.TextField', [], {'default': "''"}),
46 'description_pl': ('django.db.models.fields.TextField', [], {'default': "''"}),
47 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
48 'level': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['curriculum.Level']"})
50 u'curriculum.curriculum': {
51 'Meta': {'ordering': "['identifier']", 'object_name': 'Curriculum'},
52 'course': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['curriculum.CurriculumCourse']"}),
53 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
54 'identifier': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255', 'db_index': 'True'}),
55 'level': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['curriculum.CurriculumLevel']"}),
56 'title': ('django.db.models.fields.CharField', [], {'max_length': '1024'}),
57 'type': ('django.db.models.fields.CharField', [], {'max_length': '16'})
59 u'curriculum.curriculumcourse': {
60 'Meta': {'ordering': "['slug']", 'object_name': 'CurriculumCourse'},
61 'accusative': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
62 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
63 'slug': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}),
64 'title': ('django.db.models.fields.CharField', [], {'max_length': '255'})
66 u'curriculum.curriculumlevel': {
67 'Meta': {'object_name': 'CurriculumLevel'},
68 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
69 'title': ('django.db.models.fields.CharField', [], {'max_length': '16', 'db_index': 'True'}),
70 'verbose': ('django.db.models.fields.CharField', [], {'max_length': '32'})
72 u'curriculum.level': {
73 'Meta': {'ordering': "['order']", 'object_name': 'Level'},
74 'group_en': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '255'}),
75 'group_pl': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '255'}),
76 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
77 'meta_name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}),
78 'name_en': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '255'}),
79 'name_pl': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '255'}),
80 'order': ('django.db.models.fields.IntegerField', [], {}),
81 'package': ('django.db.models.fields.files.FileField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
82 'slug': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}),
83 'student_package': ('django.db.models.fields.files.FileField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'})
85 u'curriculum.section': {
86 'Meta': {'ordering': "['order']", 'object_name': 'Section'},
87 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
88 'name_en': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '255'}),
89 'name_pl': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '255'}),
90 'order': ('django.db.models.fields.IntegerField', [], {}),
91 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '50'})
95 complete_apps = ['curriculum']