123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171 |
- ## @author LeFactory
-
- import EditorialModel
- from EditorialModel import fieldtypes
- from EditorialModel.fieldtypes import naturerelation, char, integer, datetime, pk
-
- import leapi
- import leapi.lecrud
- import leapi.leobject
- import leapi.lerelation
- from leapi.leclass import _LeClass
- from leapi.letype import _LeType
-
- import DataSource.MySQL.leapidatasource
-
-
- ## @brief _LeCrud concret class
- # @see leapi.lecrud._LeCrud
- class LeCrud(leapi.lecrud._LeCrud):
- _datasource = DataSource.MySQL.leapidatasource.LeDataSourceSQL(**{})
- _uid_fieldtype = None
-
- ## @brief _LeObject concret class
- # @see leapi.leobject._LeObject
- class LeObject(LeCrud, leapi.leobject._LeObject):
- _me_uid = {1: 'Textes', 2: 'Personnes', 19: 'Numero', 5: 'Article', 6: 'Personne', 13: 'Publication', 14: 'Rubrique'}
- _uid_fieldtype = { 'lodel_id': EditorialModel.fieldtypes.pk.EmFieldType(**{'internal': 'automatic'}) }
- _leo_fieldtypes = {
- 'creation_date': EditorialModel.fieldtypes.datetime.EmFieldType(**{'now_on_create': True, 'internal': 'automatic'}),
- 'string': EditorialModel.fieldtypes.char.EmFieldType(**{'max_length': 128, 'internal': 'automatic'}),
- 'modification_date': EditorialModel.fieldtypes.datetime.EmFieldType(**{'now_on_update': True, 'now_on_create': True, 'internal': 'automatic'}),
- 'type_id': EditorialModel.fieldtypes.integer.EmFieldType(**{'internal': 'automatic'}),
- 'class_id': EditorialModel.fieldtypes.integer.EmFieldType(**{'internal': 'automatic'})
- }
-
- ## @brief _LeRelation concret class
- # @see leapi.lerelation._LeRelation
- class LeRelation(LeCrud, leapi.lerelation._LeRelation):
- _uid_fieldtype = { 'id_relation': EditorialModel.fieldtypes.pk.EmFieldType(**{'internal': 'automatic'}) }
- _rel_fieldtypes = {
- 'rank': EditorialModel.fieldtypes.integer.EmFieldType(**{'internal': 'automatic'}),
- 'nature': EditorialModel.fieldtypes.naturerelation.EmFieldType(**{}),
- 'depth': EditorialModel.fieldtypes.integer.EmFieldType(**{'internal': 'automatic'})
- }
- _rel_attr_fieldtypes = dict()
-
- class LeHierarch(LeRelation, leapi.lerelation._LeHierarch):
- _rel_attr_fieldtypes = dict()
-
- class LeRel2Type(LeRelation, leapi.lerelation._LeRel2Type):
- pass
-
- class LeClass(LeObject, _LeClass):
- pass
-
- class LeType(LeClass, _LeType):
- pass
-
- ## @brief EmClass Textes LeClass child class
- # @see leapi.leclass.LeClass
- class Textes(LeClass, LeObject):
- _class_id = 1
-
-
- ## @brief EmClass Personnes LeClass child class
- # @see leapi.leclass.LeClass
- class Personnes(LeClass, LeObject):
- _class_id = 2
-
-
- ## @brief EmClass Publication LeClass child class
- # @see leapi.leclass.LeClass
- class Publication(LeClass, LeObject):
- _class_id = 13
-
-
- ## @brief EmType Article LeType child class
- # @see leobject::letype::LeType
- class Article(LeType, Textes):
- _type_id = 5
-
-
- ## @brief EmType Personne LeType child class
- # @see leobject::letype::LeType
- class Personne(LeType, Personnes):
- _type_id = 6
-
-
- ## @brief EmType Rubrique LeType child class
- # @see leobject::letype::LeType
- class Rubrique(LeType, Publication):
- _type_id = 14
-
-
- ## @brief EmType Numero LeType child class
- # @see leobject::letype::LeType
- class Numero(LeType, Publication):
- _type_id = 19
-
-
- class Rel_textes2personne(LeRel2Type):
- _rel_attr_fieldtypes = {
- 'adresse': EditorialModel.fieldtypes.char.EmFieldType(**{'uniq': False, 'nullable': True, 'internal': False})
- }
-
-
- #Initialisation of Textes class attributes
- Textes._fieldtypes = {
- 'modification_date': EditorialModel.fieldtypes.datetime.EmFieldType(**{'nullable': False, 'uniq': False, 'now_on_update': True, 'now_on_create': True, 'internal': 'automatic'}),
- 'soustitre': EditorialModel.fieldtypes.char.EmFieldType(**{'uniq': False, 'nullable': True, 'internal': False}),
- 'string': EditorialModel.fieldtypes.char.EmFieldType(**{'nullable': True, 'uniq': False, 'max_length': 128, 'internal': 'automatic'}),
- 'titre': EditorialModel.fieldtypes.char.EmFieldType(**{'uniq': False, 'nullable': True, 'internal': False}),
- 'bleu': EditorialModel.fieldtypes.char.EmFieldType(**{'uniq': False, 'nullable': True, 'internal': False}),
- 'lodel_id': EditorialModel.fieldtypes.pk.EmFieldType(**{'uniq': False, 'nullable': False, 'internal': 'automatic'}),
- 'type_id': EditorialModel.fieldtypes.integer.EmFieldType(**{'uniq': False, 'nullable': False, 'internal': 'automatic'}),
- 'class_id': EditorialModel.fieldtypes.integer.EmFieldType(**{'uniq': False, 'nullable': False, 'internal': 'automatic'}),
- 'creation_date': EditorialModel.fieldtypes.datetime.EmFieldType(**{'uniq': False, 'nullable': False, 'now_on_create': True, 'internal': 'automatic'})
- }
- Textes._linked_types = [Personne]
- Textes._classtype = 'entity'
-
- #Initialisation of Personnes class attributes
- Personnes._fieldtypes = {
- 'nom': EditorialModel.fieldtypes.char.EmFieldType(**{'uniq': False, 'nullable': True, 'internal': False}),
- 'age': EditorialModel.fieldtypes.char.EmFieldType(**{'uniq': False, 'nullable': True, 'internal': False}),
- 'prenom': EditorialModel.fieldtypes.char.EmFieldType(**{'uniq': False, 'nullable': True, 'internal': False}),
- 'string': EditorialModel.fieldtypes.char.EmFieldType(**{'nullable': True, 'uniq': False, 'max_length': 128, 'internal': 'automatic'}),
- 'lodel_id': EditorialModel.fieldtypes.pk.EmFieldType(**{'uniq': False, 'nullable': False, 'internal': 'automatic'}),
- 'modification_date': EditorialModel.fieldtypes.datetime.EmFieldType(**{'nullable': False, 'uniq': False, 'now_on_update': True, 'now_on_create': True, 'internal': 'automatic'}),
- 'type_id': EditorialModel.fieldtypes.integer.EmFieldType(**{'uniq': False, 'nullable': False, 'internal': 'automatic'}),
- 'class_id': EditorialModel.fieldtypes.integer.EmFieldType(**{'uniq': False, 'nullable': False, 'internal': 'automatic'}),
- 'creation_date': EditorialModel.fieldtypes.datetime.EmFieldType(**{'uniq': False, 'nullable': False, 'now_on_create': True, 'internal': 'automatic'})
- }
- Personnes._linked_types = []
- Personnes._classtype = 'person'
-
- #Initialisation of Publication class attributes
- Publication._fieldtypes = {
- 'modification_date': EditorialModel.fieldtypes.datetime.EmFieldType(**{'nullable': False, 'uniq': False, 'now_on_update': True, 'now_on_create': True, 'internal': 'automatic'}),
- 'creation_date': EditorialModel.fieldtypes.datetime.EmFieldType(**{'uniq': False, 'nullable': False, 'now_on_create': True, 'internal': 'automatic'}),
- 'string': EditorialModel.fieldtypes.char.EmFieldType(**{'nullable': True, 'uniq': False, 'max_length': 128, 'internal': 'automatic'}),
- 'lodel_id': EditorialModel.fieldtypes.pk.EmFieldType(**{'uniq': False, 'nullable': False, 'internal': 'automatic'}),
- 'titre': EditorialModel.fieldtypes.char.EmFieldType(**{'uniq': False, 'nullable': True, 'internal': False}),
- 'type_id': EditorialModel.fieldtypes.integer.EmFieldType(**{'uniq': False, 'nullable': False, 'internal': 'automatic'}),
- 'class_id': EditorialModel.fieldtypes.integer.EmFieldType(**{'uniq': False, 'nullable': False, 'internal': 'automatic'})
- }
- Publication._linked_types = []
- Publication._classtype = 'entity'
-
- #Initialisation of Article class attributes
- Article._fields = ['titre', 'class_id', 'soustitre', 'string', 'type_id', 'lodel_id', 'modification_date', 'creation_date']
- Article._superiors = {'parent': [Rubrique]}
- Article._leclass = Textes
-
- #Initialisation of Personne class attributes
- Personne._fields = ['nom', 'class_id', 'prenom', 'string', 'type_id', 'lodel_id', 'modification_date', 'creation_date']
- Personne._superiors = {}
- Personne._leclass = Personnes
-
- #Initialisation of Rubrique class attributes
- Rubrique._fields = ['titre', 'class_id', 'string', 'type_id', 'lodel_id', 'modification_date', 'creation_date']
- Rubrique._superiors = {'parent': [Rubrique, Numero]}
- Rubrique._leclass = Publication
-
- #Initialisation of Numero class attributes
- Numero._fields = ['titre', 'class_id', 'string', 'type_id', 'lodel_id', 'modification_date', 'creation_date']
- Numero._superiors = {}
- Numero._leclass = Publication
-
- ## @brief Dict for getting LeClass and LeType child classes given an EM uid
- LeObject._me_uid = {1: Textes, 2: Personnes, 19: Numero, 5: Article, 6: Personne, 13: Publication, 14: Rubrique}
|