1 |
ec1057d8
|
Benjamin Dauvergne
|
# -*- coding: utf-8 -*-
|
2 |
017f4158
|
Mikaël Ates
|
from __future__ import unicode_literals
|
3 |
|
|
|
4 |
|
|
from django.db import models, migrations
|
5 |
|
|
from django.conf import settings
|
6 |
|
|
|
7 |
|
|
|
8 |
|
|
class Migration(migrations.Migration):
|
9 |
|
|
|
10 |
|
|
dependencies = [
|
11 |
|
|
('ressources', '0001_initial'),
|
12 |
|
|
('dossiers', '0001_initial'),
|
13 |
|
|
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
14 |
|
|
('personnes', '0001_initial'),
|
15 |
|
|
]
|
16 |
|
|
|
17 |
|
|
operations = [
|
18 |
|
|
migrations.CreateModel(
|
19 |
|
|
name='Event',
|
20 |
|
|
fields=[
|
21 |
|
|
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
22 |
|
|
('title', models.CharField(default=b'', max_length=60, verbose_name='Title', blank=True)),
|
23 |
|
|
('description', models.TextField(max_length=100, null=True, verbose_name='Description', blank=True)),
|
24 |
|
|
('create_date', models.DateTimeField(auto_now_add=True, verbose_name='Date de cr\xe9ation')),
|
25 |
|
|
('start_datetime', models.DateTimeField(verbose_name='D\xe9but', db_index=True)),
|
26 |
|
|
('end_datetime', models.DateTimeField(null=True, verbose_name='Fin', blank=True)),
|
27 |
|
|
('old_ev_id', models.CharField(max_length=8, null=True, blank=True)),
|
28 |
|
|
('old_rr_id', models.CharField(max_length=8, null=True, blank=True)),
|
29 |
|
|
('old_rs_id', models.CharField(max_length=8, null=True, blank=True)),
|
30 |
|
|
('exception_date', models.DateField(db_index=True, null=True, verbose_name='Report\xe9 du', blank=True)),
|
31 |
|
|
('canceled', models.BooleanField(default=False, db_index=True, verbose_name='Annul\xe9')),
|
32 |
|
|
('recurrence_periodicity', models.PositiveIntegerField(default=None, choices=[(1, 'Toutes les semaines'), (2, 'Une semaine sur deux'), (3, 'Une semaine sur trois'), (4, 'Une semaine sur quatre'), (5, 'Une semaine sur cinq'), (6, 'La premi\xe8re semaine du mois'), (7, 'La deuxi\xe8me semaine du mois'), (8, 'La troisi\xe8me semaine du mois'), (9, 'La quatri\xe8me semaine du mois'), (13, 'La cinqui\xe8me semaine du mois'), (10, 'La derni\xe8re semaine du mois'), (11, 'Les semaines paires'), (12, 'Les semaines impaires')], blank=True, null=True, verbose_name='P\xe9riodicit\xe9', db_index=True)),
|
33 |
|
|
('recurrence_week_day', models.PositiveIntegerField(default=0, db_index=True)),
|
34 |
|
|
('recurrence_week_offset', models.PositiveIntegerField(default=0, db_index=True, verbose_name='D\xe9calage en semaines par rapport au 1/1/1970 pour le calcul de p\xe9riode', choices=[(0, 0), (1, 1), (2, 2), (3, 3)])),
|
35 |
|
|
('recurrence_week_period', models.PositiveIntegerField(default=None, choices=[(1, 'Toutes les semaines'), (2, 'Une semaine sur deux'), (3, 'Une semaine sur trois'), (4, 'Une semaine sur quatre'), (5, 'Une semaine sur cinq')], blank=True, null=True, verbose_name='P\xe9riode en semaines', db_index=True)),
|
36 |
|
|
('recurrence_week_rank', models.IntegerField(blank=True, null=True, verbose_name='Rang de la semaine dans le mois', db_index=True, choices=[(0, 'La premi\xe8re semaine du mois'), (1, 'La deuxi\xe8me semaine du mois'), (2, 'La troisi\xe8me semaine du mois'), (3, 'La quatri\xe8me semaine du mois'), (4, 'La cinqui\xe8me semaine du mois'), (-1, 'La derni\xe8re semaine du mois')])),
|
37 |
|
|
('recurrence_week_parity', models.PositiveIntegerField(blank=True, null=True, verbose_name='Parit\xe9 des semaines', db_index=True, choices=[(0, 'Les semaines paires'), (1, 'Les semaines impaires')])),
|
38 |
|
|
('recurrence_end_date', models.DateField(db_index=True, null=True, verbose_name='Fin de la r\xe9currence', blank=True)),
|
39 |
|
|
],
|
40 |
|
|
options={
|
41 |
|
|
'ordering': ('start_datetime', 'end_datetime', 'title'),
|
42 |
|
|
'verbose_name': 'Ev\xe9nement',
|
43 |
|
|
'verbose_name_plural': 'Ev\xe9nements',
|
44 |
|
|
},
|
45 |
|
|
bases=(models.Model,),
|
46 |
|
|
),
|
47 |
|
|
migrations.CreateModel(
|
48 |
|
|
name='EventType',
|
49 |
|
|
fields=[
|
50 |
|
|
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
51 |
|
|
('label', models.CharField(max_length=50, verbose_name='label')),
|
52 |
|
|
('rank', models.IntegerField(default=0, null=True, verbose_name='Sorting Rank', blank=True)),
|
53 |
|
|
],
|
54 |
|
|
options={
|
55 |
|
|
'verbose_name': "Type d'\xe9v\xe9nement",
|
56 |
|
|
'verbose_name_plural': "Types d'\xe9v\xe9nement",
|
57 |
|
|
},
|
58 |
|
|
bases=(models.Model,),
|
59 |
|
|
),
|
60 |
|
|
migrations.CreateModel(
|
61 |
|
|
name='EventWithAct',
|
62 |
|
|
fields=[
|
63 |
|
|
('event_ptr', models.OneToOneField(parent_link=True, auto_created=True, primary_key=True, serialize=False, to='agenda.Event')),
|
64 |
|
|
('convocation_sent', models.BooleanField(default=False, db_index=True, verbose_name='Convoqu\xe9')),
|
65 |
|
|
('act_type', models.ForeignKey(verbose_name="Type d'acte", to='ressources.ActType')),
|
66 |
|
|
('patient', models.ForeignKey(to='dossiers.PatientRecord')),
|
67 |
|
|
],
|
68 |
|
|
options={
|
69 |
|
|
},
|
70 |
|
|
bases=('agenda.event',),
|
71 |
|
|
),
|
72 |
|
|
migrations.AddField(
|
73 |
|
|
model_name='event',
|
74 |
|
|
name='creator',
|
75 |
|
|
field=models.ForeignKey(verbose_name='Cr\xe9ateur', blank=True, to=settings.AUTH_USER_MODEL, null=True),
|
76 |
|
|
preserve_default=True,
|
77 |
|
|
),
|
78 |
|
|
migrations.AddField(
|
79 |
|
|
model_name='event',
|
80 |
|
|
name='event_type',
|
81 |
|
|
field=models.ForeignKey(verbose_name="Type d'\xe9v\xe9nement", to='agenda.EventType'),
|
82 |
|
|
preserve_default=True,
|
83 |
|
|
),
|
84 |
|
|
migrations.AddField(
|
85 |
|
|
model_name='event',
|
86 |
|
|
name='exception_to',
|
87 |
|
|
field=models.ForeignKey(related_name='exceptions', verbose_name='Exception \xe0', blank=True, to='agenda.Event', null=True),
|
88 |
|
|
preserve_default=True,
|
89 |
|
|
),
|
90 |
|
|
migrations.AddField(
|
91 |
|
|
model_name='event',
|
92 |
|
|
name='participants',
|
93 |
|
|
field=models.ManyToManyField(default=None, to='personnes.People', null=True, blank=True),
|
94 |
|
|
preserve_default=True,
|
95 |
|
|
),
|
96 |
|
|
migrations.AddField(
|
97 |
|
|
model_name='event',
|
98 |
|
|
name='ressource',
|
99 |
|
|
field=models.ForeignKey(verbose_name='Ressource', blank=True, to='ressources.Ressource', null=True),
|
100 |
|
|
preserve_default=True,
|
101 |
|
|
),
|
102 |
|
|
migrations.AddField(
|
103 |
|
|
model_name='event',
|
104 |
|
|
name='services',
|
105 |
|
|
field=models.ManyToManyField(default=None, to='ressources.Service', null=True, blank=True),
|
106 |
|
|
preserve_default=True,
|
107 |
|
|
),
|
108 |
|
|
migrations.AlterUniqueTogether(
|
109 |
|
|
name='event',
|
110 |
|
|
unique_together=set([('exception_to', 'exception_date')]),
|
111 |
|
|
),
|
112 |
|
|
]
|