Project

General

Profile

Download (17.6 KB) Statistics
| Branch: | Tag: | Revision:

calebasse / calebasse / personnes / migrations / 0003_auto.py @ 0d4bf0b4

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
    no_dry_run = True
10

    
11
    def forwards(self, orm):
12
        # Adding M2M table for field services on 'Holiday'
13
        m2m_table_name = db.shorten_name('personnes_holiday_services')
14
        db.create_table(m2m_table_name, (
15
            ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
16
            ('holiday', models.ForeignKey(orm['personnes.holiday'], null=False)),
17
            ('service', models.ForeignKey(orm['ressources.service'], null=False))
18
        ))
19
        db.create_unique(m2m_table_name, ['holiday_id', 'service_id'])
20

    
21
        for obj in orm.Holiday.objects.all():
22
            if obj.service:
23
                obj.services.add(obj.service)
24
            else:
25
                for service in orm['ressources.Service'].objects.all():
26
                    obj.services.add(service)
27
            obj.save()
28

    
29
    def backwards(self, orm):
30
        # Removing M2M table for field services on 'Holiday'
31
        db.delete_table(db.shorten_name('personnes_holiday_services'))
32

    
33

    
34
    models = {
35
        'auth.group': {
36
            'Meta': {'object_name': 'Group'},
37
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
38
            'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
39
            'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
40
        },
41
        'auth.permission': {
42
            'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'},
43
            'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
44
            'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
45
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
46
            'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
47
        },
48
        'auth.user': {
49
            'Meta': {'object_name': 'User'},
50
            'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
51
            'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
52
            'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
53
            'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
54
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
55
            'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
56
            'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
57
            'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
58
            'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
59
            'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
60
            'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
61
            'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
62
            'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
63
        },
64
        'contenttypes.contenttype': {
65
            'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
66
            'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
67
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
68
            'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
69
            'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
70
        },
71
        'personnes.externaltherapist': {
72
            'Meta': {'ordering': "['last_name', 'first_name']", 'object_name': 'ExternalTherapist', '_ormbases': ['personnes.People']},
73
            'address': ('django.db.models.fields.CharField', [], {'default': 'None', 'max_length': '120', 'null': 'True', 'blank': 'True'}),
74
            'address_complement': ('django.db.models.fields.CharField', [], {'default': 'None', 'max_length': '120', 'null': 'True', 'blank': 'True'}),
75
            'city': ('django.db.models.fields.CharField', [], {'default': 'None', 'max_length': '80', 'null': 'True', 'blank': 'True'}),
76
            'description': ('django.db.models.fields.TextField', [], {'default': 'None', 'null': 'True', 'blank': 'True'}),
77
            'fax': ('django.db.models.fields.CharField', [], {'default': 'None', 'max_length': '30', 'null': 'True', 'blank': 'True'}),
78
            'old_id': ('django.db.models.fields.CharField', [], {'max_length': '256', 'null': 'True', 'blank': 'True'}),
79
            'old_service': ('django.db.models.fields.CharField', [], {'max_length': '256', 'null': 'True', 'blank': 'True'}),
80
            'people_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['personnes.People']", 'unique': 'True', 'primary_key': 'True'}),
81
            'phone_work': ('calebasse.models.PhoneNumberField', [], {'default': 'None', 'max_length': '20', 'null': 'True', 'blank': 'True'}),
82
            'type': ('django.db.models.fields.related.ForeignKey', [], {'default': '18', 'to': "orm['ressources.WorkerType']"}),
83
            'zip_code': ('calebasse.models.ZipCodeField', [], {'default': 'None', 'max_length': '5', 'null': 'True', 'blank': 'True'})
84
        },
85
        'personnes.externalworker': {
86
            'Meta': {'ordering': "['last_name', 'first_name']", 'object_name': 'ExternalWorker', '_ormbases': ['personnes.People']},
87
            'address': ('django.db.models.fields.CharField', [], {'default': 'None', 'max_length': '120', 'null': 'True', 'blank': 'True'}),
88
            'address_complement': ('django.db.models.fields.CharField', [], {'default': 'None', 'max_length': '120', 'null': 'True', 'blank': 'True'}),
89
            'city': ('django.db.models.fields.CharField', [], {'default': 'None', 'max_length': '80', 'null': 'True', 'blank': 'True'}),
90
            'description': ('django.db.models.fields.TextField', [], {'default': 'None', 'null': 'True', 'blank': 'True'}),
91
            'fax': ('django.db.models.fields.CharField', [], {'default': 'None', 'max_length': '30', 'null': 'True', 'blank': 'True'}),
92
            'old_id': ('django.db.models.fields.CharField', [], {'max_length': '256', 'null': 'True', 'blank': 'True'}),
93
            'old_service': ('django.db.models.fields.CharField', [], {'max_length': '256', 'null': 'True', 'blank': 'True'}),
94
            'people_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['personnes.People']", 'unique': 'True', 'primary_key': 'True'}),
95
            'phone_work': ('calebasse.models.PhoneNumberField', [], {'default': 'None', 'max_length': '20', 'null': 'True', 'blank': 'True'}),
96
            'type': ('django.db.models.fields.related.ForeignKey', [], {'default': '18', 'to': "orm['ressources.WorkerType']"}),
97
            'zip_code': ('calebasse.models.ZipCodeField', [], {'default': 'None', 'max_length': '5', 'null': 'True', 'blank': 'True'})
98
        },
99
        'personnes.holiday': {
100
            'Meta': {'ordering': "('start_date', 'start_time')", 'object_name': 'Holiday'},
101
            'comment': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
102
            'end_date': ('django.db.models.fields.DateField', [], {}),
103
            'end_time': ('django.db.models.fields.TimeField', [], {'null': 'True', 'blank': 'True'}),
104
            'holiday_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ressources.HolidayType']"}),
105
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
106
            'service': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ressources.Service']", 'null': 'True', 'blank': 'True'}),
107
            'services': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'new_services'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['ressources.Service']"}),
108
            'start_date': ('django.db.models.fields.DateField', [], {}),
109
            'start_time': ('django.db.models.fields.TimeField', [], {'null': 'True', 'blank': 'True'}),
110
            'worker': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['personnes.Worker']", 'null': 'True', 'blank': 'True'})
111
        },
112
        'personnes.people': {
113
            'Meta': {'ordering': "['last_name', 'first_name']", 'object_name': 'People'},
114
            'display_name': ('django.db.models.fields.CharField', [], {'max_length': '256', 'db_index': 'True'}),
115
            'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'null': 'True', 'blank': 'True'}),
116
            'first_name': ('django.db.models.fields.CharField', [], {'max_length': '128', 'null': 'True', 'blank': 'True'}),
117
            'gender': ('django.db.models.fields.IntegerField', [], {'max_length': '1', 'null': 'True', 'blank': 'True'}),
118
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
119
            'last_name': ('django.db.models.fields.CharField', [], {'max_length': '128', 'db_index': 'True'}),
120
            'phone': ('calebasse.models.PhoneNumberField', [], {'max_length': '20', 'null': 'True', 'blank': 'True'})
121
        },
122
        'personnes.role': {
123
            'Meta': {'ordering': "['name']", 'object_name': 'Role'},
124
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
125
            'name': ('django.db.models.fields.CharField', [], {'max_length': '150'}),
126
            'users': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.User']", 'symmetrical': 'False', 'blank': 'True'})
127
        },
128
        'personnes.schoolteacher': {
129
            'Meta': {'ordering': "['last_name', 'first_name']", 'object_name': 'SchoolTeacher', '_ormbases': ['personnes.People']},
130
            'people_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['personnes.People']", 'unique': 'True', 'primary_key': 'True'}),
131
            'role': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ressources.SchoolTeacherRole']"}),
132
            'schools': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['ressources.School']", 'symmetrical': 'False'})
133
        },
134
        'personnes.timetable': {
135
            'Meta': {'object_name': 'TimeTable'},
136
            'end_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),
137
            'end_time': ('django.db.models.fields.TimeField', [], {}),
138
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
139
            'periodicity': ('django.db.models.fields.PositiveIntegerField', [], {'default': '1', 'null': 'True', 'blank': 'True'}),
140
            'services': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['ressources.Service']", 'symmetrical': 'False'}),
141
            'start_date': ('django.db.models.fields.DateField', [], {}),
142
            'start_time': ('django.db.models.fields.TimeField', [], {}),
143
            'week_offset': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}),
144
            'week_parity': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True', 'blank': 'True'}),
145
            'week_period': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True', 'blank': 'True'}),
146
            'week_rank': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True', 'blank': 'True'}),
147
            'weekday': ('django.db.models.fields.PositiveIntegerField', [], {}),
148
            'worker': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['personnes.Worker']"})
149
        },
150
        'personnes.userworker': {
151
            'Meta': {'object_name': 'UserWorker'},
152
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
153
            'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}),
154
            'worker': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['personnes.Worker']"})
155
        },
156
        'personnes.worker': {
157
            'Meta': {'ordering': "['last_name', 'first_name']", 'object_name': 'Worker', '_ormbases': ['personnes.People']},
158
            'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
159
            'initials': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '5', 'blank': 'True'}),
160
            'old_camsp_id': ('django.db.models.fields.CharField', [], {'max_length': '256', 'null': 'True', 'blank': 'True'}),
161
            'old_cmpp_id': ('django.db.models.fields.CharField', [], {'max_length': '256', 'null': 'True', 'blank': 'True'}),
162
            'old_sessad_dys_id': ('django.db.models.fields.CharField', [], {'max_length': '256', 'null': 'True', 'blank': 'True'}),
163
            'old_sessad_ted_id': ('django.db.models.fields.CharField', [], {'max_length': '256', 'null': 'True', 'blank': 'True'}),
164
            'people_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['personnes.People']", 'unique': 'True', 'primary_key': 'True'}),
165
            'services': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['ressources.Service']", 'null': 'True', 'blank': 'True'}),
166
            'type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ressources.WorkerType']"})
167
        },
168
        'ressources.holidaytype': {
169
            'Meta': {'object_name': 'HolidayType'},
170
            'for_group': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
171
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
172
            'name': ('django.db.models.fields.CharField', [], {'max_length': '150'})
173
        },
174
        'ressources.school': {
175
            'Meta': {'object_name': 'School'},
176
            'address': ('django.db.models.fields.CharField', [], {'default': 'None', 'max_length': '120', 'null': 'True', 'blank': 'True'}),
177
            'address_complement': ('django.db.models.fields.CharField', [], {'default': 'None', 'max_length': '120', 'null': 'True', 'blank': 'True'}),
178
            'city': ('django.db.models.fields.CharField', [], {'default': 'None', 'max_length': '80', 'null': 'True', 'blank': 'True'}),
179
            'description': ('django.db.models.fields.TextField', [], {'default': 'None', 'null': 'True', 'blank': 'True'}),
180
            'director_name': ('django.db.models.fields.CharField', [], {'default': 'None', 'max_length': '70', 'null': 'True', 'blank': 'True'}),
181
            'email': ('django.db.models.fields.EmailField', [], {'default': 'None', 'max_length': '75', 'null': 'True', 'blank': 'True'}),
182
            'fax': ('django.db.models.fields.CharField', [], {'default': 'None', 'max_length': '30', 'null': 'True', 'blank': 'True'}),
183
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
184
            'name': ('django.db.models.fields.CharField', [], {'max_length': '150'}),
185
            'old_id': ('django.db.models.fields.CharField', [], {'max_length': '256', 'null': 'True', 'blank': 'True'}),
186
            'old_service': ('django.db.models.fields.CharField', [], {'max_length': '256', 'null': 'True', 'blank': 'True'}),
187
            'phone': ('calebasse.models.PhoneNumberField', [], {'default': 'None', 'max_length': '20', 'null': 'True', 'blank': 'True'}),
188
            'school_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ressources.SchoolType']"}),
189
            'zip_code': ('calebasse.models.ZipCodeField', [], {'default': 'None', 'max_length': '5', 'null': 'True', 'blank': 'True'})
190
        },
191
        'ressources.schoolteacherrole': {
192
            'Meta': {'object_name': 'SchoolTeacherRole'},
193
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
194
            'name': ('django.db.models.fields.CharField', [], {'max_length': '150'})
195
        },
196
        'ressources.schooltype': {
197
            'Meta': {'object_name': 'SchoolType'},
198
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
199
            'name': ('django.db.models.fields.CharField', [], {'max_length': '150'}),
200
            'services': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['ressources.Service']", 'symmetrical': 'False'})
201
        },
202
        'ressources.service': {
203
            'Meta': {'object_name': 'Service'},
204
            'description': ('django.db.models.fields.TextField', [], {}),
205
            'email': ('django.db.models.fields.EmailField', [], {'max_length': '75'}),
206
            'fax': ('calebasse.models.PhoneNumberField', [], {'max_length': '20'}),
207
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
208
            'name': ('django.db.models.fields.CharField', [], {'max_length': '150'}),
209
            'phone': ('calebasse.models.PhoneNumberField', [], {'max_length': '20'}),
210
            'slug': ('django.db.models.fields.SlugField', [], {'max_length': '50'})
211
        },
212
        'ressources.workertype': {
213
            'Meta': {'object_name': 'WorkerType'},
214
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
215
            'intervene': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
216
            'name': ('django.db.models.fields.CharField', [], {'max_length': '150'})
217
        }
218
    }
219

    
220
    complete_apps = ['personnes']
(3-3/5)