Project

General

Profile

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

calebasse / calebasse / personnes / migrations / 0003_auto.py @ ab282e2b

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 M2M table for field services on 'Holiday'
12
        m2m_table_name = db.shorten_name('personnes_holiday_services')
13
        db.create_table(m2m_table_name, (
14
            ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
15
            ('holiday', models.ForeignKey(orm['personnes.holiday'], null=False)),
16
            ('service', models.ForeignKey(orm['ressources.service'], null=False))
17
        ))
18
        db.create_unique(m2m_table_name, ['holiday_id', 'service_id'])
19

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

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

    
32

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

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