796cf70f4a1087db630be7df9c9e19fed1e8727d
[auf_paf.git] / paf / migrations / 0009_auto__add_area__add_field_location_area__add_field_location_city__add_.py
1 # -*- coding: utf-8 -*-
2 import datetime
3 from south.db import db
4 from south.v2 import SchemaMigration
5 from django.db import models
6
7
8 class Migration(SchemaMigration):
9
10 def forwards(self, orm):
11 # Adding model 'Area'
12 db.create_table('paf_area', (
13 ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
14 ('name', self.gf('django.db.models.fields.CharField')(max_length=100)),
15 ('country', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['paf.Country'])),
16 ))
17 db.send_create_signal('paf', ['Area'])
18
19 # Adding field 'Location.area'
20 db.add_column('paf_location', 'area',
21 self.gf('smart_selects.db_fields.ChainedForeignKey')(default=1, to=orm['paf.Area']),
22 keep_default=False)
23
24 # Adding field 'Location.city'
25 db.add_column('paf_location', 'city',
26 self.gf('django.db.models.fields.CharField')(default=2, max_length=50),
27 keep_default=False)
28
29 # Adding field 'Location.street'
30 db.add_column('paf_location', 'street',
31 self.gf('django.db.models.fields.CharField')(default=2, max_length=100),
32 keep_default=False)
33
34
35 # Changing field 'Location.country'
36 db.alter_column('paf_location', 'country_id', self.gf('smart_selects.db_fields.ChainedForeignKey')(to=orm['paf.Country']))
37
38 def backwards(self, orm):
39 # Deleting model 'Area'
40 db.delete_table('paf_area')
41
42 # Deleting field 'Location.area'
43 db.delete_column('paf_location', 'area_id')
44
45 # Deleting field 'Location.city'
46 db.delete_column('paf_location', 'city')
47
48 # Deleting field 'Location.street'
49 db.delete_column('paf_location', 'street')
50
51
52 # Changing field 'Location.country'
53 db.alter_column('paf_location', 'country_id', self.gf('smart_selects.db_fields.GroupedForeignKey')(to=orm['paf.Country'], group_field='continent'))
54
55 models = {
56 'paf.area': {
57 'Meta': {'object_name': 'Area'},
58 'country': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['paf.Country']"}),
59 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
60 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
61 },
62 'paf.continent': {
63 'Meta': {'object_name': 'Continent'},
64 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
65 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
66 },
67 'paf.country': {
68 'Meta': {'object_name': 'Country'},
69 'continent': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['paf.Continent']"}),
70 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
71 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
72 },
73 'paf.currentacademic': {
74 'Meta': {'object_name': 'CurrentAcademic'},
75 'faculty': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['paf.Faculty']"}),
76 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'})
77 },
78 'paf.faculty': {
79 'Meta': {'object_name': 'Faculty'},
80 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
81 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
82 'university': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['paf.University']"})
83 },
84 'paf.linguisticlevel': {
85 'Meta': {'object_name': 'LinguisticLevel'},
86 'delf_dalf': ('django.db.models.fields.CharField', [], {'max_length': '2', 'blank': 'True'}),
87 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
88 'other': ('django.db.models.fields.CharField', [], {'max_length': '1', 'blank': 'True'}),
89 'student': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['paf.Student']", 'unique': 'True'}),
90 'year_delf_dalf': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True', 'blank': 'True'}),
91 'year_other': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True', 'blank': 'True'})
92 },
93 'paf.location': {
94 'Meta': {'object_name': 'Location'},
95 'area': ('smart_selects.db_fields.ChainedForeignKey', [], {'to': "orm['paf.Area']"}),
96 'city': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
97 'continent': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['paf.Continent']"}),
98 'country': ('smart_selects.db_fields.ChainedForeignKey', [], {'to': "orm['paf.Country']"}),
99 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
100 'street': ('django.db.models.fields.CharField', [], {'max_length': '100'})
101 },
102 'paf.student': {
103 'Meta': {'object_name': 'Student'},
104 'dob': ('django.db.models.fields.DateField', [], {}),
105 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
106 'firstname': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
107 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
108 'identifier': ('django.db.models.fields.CharField', [], {'max_length': '9', 'blank': 'True'}),
109 'lastname': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
110 'nationality': ('django.db.models.fields.CharField', [], {'max_length': '2'}),
111 'parent_address': ('django.db.models.fields.CharField', [], {'max_length': '120'}),
112 'parent_tel': ('django.db.models.fields.CharField', [], {'max_length': '20', 'blank': 'True'}),
113 'sex': ('django.db.models.fields.CharField', [], {'max_length': '1'}),
114 'tel': ('django.db.models.fields.CharField', [], {'max_length': '20'})
115 },
116 'paf.university': {
117 'Meta': {'object_name': 'University'},
118 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
119 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
120 }
121 }
122
123 complete_apps = ['paf']