|
@@ -5,6 +5,7 @@ import copy
|
5
|
5
|
import os.path
|
6
|
6
|
|
7
|
7
|
import EditorialModel
|
|
8
|
+from EditorialModel import classtypes
|
8
|
9
|
from EditorialModel.model import Model
|
9
|
10
|
from EditorialModel.fieldtypes.generic import GenericFieldType
|
10
|
11
|
from leapi.lecrud import _LeCrud
|
|
@@ -196,25 +197,6 @@ import %s
|
196
|
197
|
(leobj_uid_fieldtype, leobj_fieldtypes) = self.concret_fieldtypes(EditorialModel.classtypes.common_fields)
|
197
|
198
|
#Building the fieldtypes dict for LeRelation
|
198
|
199
|
(lerel_uid_fieldtype, lerel_fieldtypes) = self.concret_fieldtypes(EditorialModel.classtypes.relations_common_fields)
|
199
|
|
- # Fetching superior and subordinate fieldname for LeRelation
|
200
|
|
- lesup = None
|
201
|
|
- lesub = None
|
202
|
|
- for fname, finfo in EditorialModel.classtypes.relations_common_fields.items():
|
203
|
|
- if finfo['fieldtype'] == 'leo':
|
204
|
|
- if finfo['superior']:
|
205
|
|
- lesup = fname
|
206
|
|
- else:
|
207
|
|
- lesub = fname
|
208
|
|
- # Fetch class_id and type_id fieldnames for LeObject
|
209
|
|
- class_id = None
|
210
|
|
- type_id = None
|
211
|
|
- for fname, finfo in EditorialModel.classtypes.common_fields.items():
|
212
|
|
- if finfo['fieldtype'] == 'emuid':
|
213
|
|
- if finfo['is_id_class']:
|
214
|
|
- class_id = fname
|
215
|
|
- else:
|
216
|
|
- type_id = fname
|
217
|
|
- # TEST IF SOME OF THE ARE NONE !!!
|
218
|
200
|
|
219
|
201
|
result += """
|
220
|
202
|
## @brief _LeCrud concret class
|
|
@@ -236,7 +218,9 @@ class LeObject(LeCrud, leapi.leobject._LeObject):
|
236
|
218
|
class LeRelation(LeCrud, leapi.lerelation._LeRelation):
|
237
|
219
|
_uid_fieldtype = {lerel_uid_fieldtype}
|
238
|
220
|
_rel_fieldtypes = {lerel_fieldtypes}
|
|
221
|
+ ## WARNING !!!! OBSOLETE ! DON'T USE IT
|
239
|
222
|
_superior_field_name = {lesup_name}
|
|
223
|
+ ## WARNING !!!! OBSOLETE ! DON'T USE IT
|
240
|
224
|
_subordinate_field_name = {lesub_name}
|
241
|
225
|
|
242
|
226
|
class LeHierarch(LeRelation, leapi.lerelation._LeHierarch):
|
|
@@ -258,10 +242,10 @@ class LeType(LeClass, _LeType):
|
258
|
242
|
leo_fieldtypes = '{\n\t' + (',\n\t'.join(leobj_fieldtypes))+ '\n\t}',
|
259
|
243
|
lerel_fieldtypes = '{\n\t' + (',\n\t'.join(lerel_fieldtypes))+ '\n\t}',
|
260
|
244
|
lerel_uid_fieldtype = lerel_uid_fieldtype,
|
261
|
|
- lesup_name = repr(lesup),
|
262
|
|
- lesub_name = repr(lesub),
|
263
|
|
- class_id = repr(class_id),
|
264
|
|
- type_id = repr(type_id),
|
|
245
|
+ lesup_name = repr(classtypes.relation_superior),
|
|
246
|
+ lesub_name = repr(classtypes.relation_subordinate),
|
|
247
|
+ class_id = repr(classtypes.object_em_class_id),
|
|
248
|
+ type_id = repr(classtypes.object_em_type_id),
|
265
|
249
|
)
|
266
|
250
|
|
267
|
251
|
emclass_l = model.components(EditorialModel.classes.EmClass)
|