Version 0.13
[auf_django_references.git] / auf / django / references / models.py
CommitLineData
b98fea67
EMS
1# -=- encoding: utf-8 -=-
2
3from django.db import models
4
652c5d02
EMS
5from auf.django.references.managedref import models as managedref
6
a10aee41
EMS
7
8### Proxies vers les modèles dans managedref
9
10class Pays(managedref.Pays):
b98fea67
EMS
11
12 class Meta:
a10aee41 13 proxy = True
52169434 14 managed = False
b98fea67 15
b98fea67 16
a10aee41 17class Region(managedref.Region):
b98fea67
EMS
18
19 class Meta:
a10aee41 20 proxy = True
52169434 21 managed = False
b98fea67 22
b98fea67 23
a10aee41 24class Bureau(managedref.Bureau):
b98fea67
EMS
25
26 class Meta:
a10aee41 27 proxy = True
52169434 28 managed = False
b98fea67 29
b98fea67 30
a10aee41 31class Implantation(managedref.Implantation):
b98fea67
EMS
32
33 class Meta:
a10aee41 34 proxy = True
52169434 35 managed = False
b98fea67 36
b98fea67 37
a10aee41 38class Etablissement(managedref.Etablissement):
b98fea67
EMS
39
40 class Meta:
a10aee41 41 proxy = True
52169434 42 managed = False
b98fea67 43
a10aee41
EMS
44
45class Employe(managedref.Employe):
b98fea67
EMS
46
47 class Meta:
a10aee41 48 proxy = True
52169434 49 managed = False
b98fea67 50
a10aee41
EMS
51
52class Authentification(managedref.Authentification):
b98fea67
EMS
53
54 class Meta:
a10aee41 55 proxy = True
52169434 56 managed = False
b98fea67 57
a10aee41
EMS
58
59class Service(managedref.Service):
b98fea67
EMS
60
61 class Meta:
a10aee41 62 proxy = True
52169434 63 managed = False
b98fea67 64
a10aee41
EMS
65
66class PosteType(managedref.PosteType):
b98fea67
EMS
67
68 class Meta:
a10aee41 69 proxy = True
52169434 70 managed = False
b98fea67 71
a10aee41
EMS
72
73class GroupeArh(managedref.GroupeArh):
b98fea67
EMS
74
75 class Meta:
a10aee41 76 proxy = True
52169434 77 managed = False
b98fea67 78
a10aee41
EMS
79
80class GroupeDirRegion(managedref.GroupeDirRegion):
b98fea67
EMS
81
82 class Meta:
a10aee41 83 proxy = True
52169434 84 managed = False
b98fea67 85
a10aee41
EMS
86
87class GroupeAdmRegion(managedref.GroupeAdmRegion):
b98fea67
EMS
88
89 class Meta:
a10aee41 90 proxy = True
52169434 91 managed = False
b98fea67 92
a10aee41
EMS
93
94class GroupeRespImplantation(managedref.GroupeRespImplantation):
b98fea67
EMS
95
96 class Meta:
a10aee41 97 proxy = True
52169434 98 managed = False
b98fea67 99
a10aee41
EMS
100
101class GroupeDirProgramme(managedref.GroupeDirProgramme):
b98fea67
EMS
102
103 class Meta:
a10aee41 104 proxy = True
52169434 105 managed = False
b98fea67 106
b98fea67 107
a10aee41 108class GroupeDirDelegProgrammeReg(managedref.GroupeDirDelegProgrammeReg):
b98fea67
EMS
109
110 class Meta:
a10aee41 111 proxy = True
52169434 112 managed = False
b98fea67 113
a10aee41
EMS
114
115class GroupeComptable(managedref.GroupeComptable):
b98fea67
EMS
116
117 class Meta:
a10aee41 118 proxy = True
52169434 119 managed = False
b98fea67 120
a10aee41
EMS
121
122class GroupeComptableRegional(managedref.GroupeComptableRegional):
b98fea67
EMS
123
124 class Meta:
a10aee41 125 proxy = True
52169434 126 managed = False
b98fea67 127
b98fea67 128
a10aee41 129class GroupeComptableLocal(managedref.GroupeComptableLocal):
b98fea67
EMS
130
131 class Meta:
a10aee41 132 proxy = True
52169434 133 managed = False
b98fea67 134
b98fea67 135
a10aee41 136class Discipline(managedref.Discipline):
b98fea67
EMS
137
138 class Meta:
a10aee41 139 proxy = True
52169434 140 managed = False
b98fea67 141
b98fea67 142
a10aee41 143class Programme(managedref.Programme):
b98fea67
EMS
144
145 class Meta:
a10aee41 146 proxy = True
52169434 147 managed = False
b98fea67 148
b98fea67 149
a10aee41 150class Projet(managedref.Projet):
b98fea67
EMS
151
152 class Meta:
a10aee41 153 proxy = True
52169434 154 managed = False
b98fea67 155
b98fea67 156
a10aee41 157class ProjetComposante(managedref.ProjetComposante):
b98fea67 158
52169434 159 class Meta:
a10aee41 160 proxy = True
52169434
EMS
161 managed = False
162
b98fea67 163
a10aee41 164class UniteProjet(managedref.UniteProjet):
b98fea67
EMS
165
166 class Meta:
a10aee41 167 proxy = True
52169434 168 managed = False
b98fea67 169
a10aee41
EMS
170
171class ObjectifSpecifique(managedref.ObjectifSpecifique):
b98fea67
EMS
172
173 class Meta:
a10aee41 174 proxy = True
52169434 175 managed = False
b98fea67 176
b98fea67 177
a10aee41 178class ObjectifStrategique(managedref.ObjectifStrategique):
652c5d02
EMS
179
180 class Meta:
181 proxy = True
182 managed = False
183
184
a10aee41 185class Thematique(managedref.Thematique):
652c5d02
EMS
186
187 class Meta:
188 proxy = True
189 managed = False
190
191
a10aee41 192class ProjetUp(managedref.ProjetUp):
652c5d02
EMS
193
194 class Meta:
195 proxy = True
196 managed = False
197
198
a10aee41 199class Poste(managedref.Poste):
652c5d02
EMS
200
201 class Meta:
202 proxy = True
203 managed = False
204
205
a10aee41 206class ProjetPoste(managedref.ProjetPoste):
652c5d02
EMS
207
208 class Meta:
209 proxy = True
210 managed = False
211
212
213### Modèles abstraits
214
215class EtablissementBase(managedref.EtablissementBase):
88438641
EMS
216 ref = models.OneToOneField(Etablissement, blank=True, null=True,
217 related_name='%(app_label)s_%(class)s')
652c5d02
EMS
218
219 class Meta:
220 abstract = True
221
222 def save(self, *args, **kwargs):
223 if self.ref and not self.pk:
224 # Nouvel établissement faisant référence à un établissement dans
225 # les références. On copie tous les champs.
226 for f in self.ref._meta.fields:
227 if f.attname != 'id':
228 setattr(self, f.attname, getattr(self.ref, f.attname))
229 super(EtablissementBase, self).save(*args, **kwargs)