Browse Source

Correction: ajout de la valeur de ranked_in pour chaque classe 'em_*'

Driky 9 years ago
parent
commit
347a302e85

+ 1
- 0
EditorialModel/classes.py View File

@@ -19,6 +19,7 @@ import EditorialModel
19 19
 class EmClass(EmComponent):
20 20
 
21 21
     table = 'em_class'
22
+    ranked_in = 'classtype'
22 23
 
23 24
     ## @brief Specific EmClass fields
24 25
     # @see EditorialModel::components::EmComponent::_fields

+ 1
- 1
EditorialModel/components.py View File

@@ -239,7 +239,7 @@ class EmComponent(object):
239 239
     #return int
240 240
     @classmethod
241 241
     def get_max_rank(cls, ranked_in_value):
242
-        dbe = cls.getDbE()
242
+        dbe = cls.db_engine()
243 243
         component = sql.Table(cls.table, sqlutils.meta(dbe))
244 244
         req = sql.sql.select([component.c.rank]).where(getattr(component.c, cls.ranked_in) == ranked_in_value).order_by(component.c.rank.desc())
245 245
         c = dbe.connect()

+ 2
- 0
EditorialModel/fieldgroups.py View File

@@ -17,6 +17,8 @@ class EmFieldGroup(EmComponent):
17 17
 
18 18
     ## The database table name
19 19
     table = 'em_fieldgroup'
20
+    ranked_in='class_id'
21
+
20 22
     ## List of fields
21 23
     # @todo Bad storage, here we want an ordereddict not a tuple list
22 24
     _fields = [('class_id', ftypes.EmField_integer)]

+ 1
- 0
EditorialModel/fields.py View File

@@ -22,6 +22,7 @@ logger = logging.getLogger('Lodel2.EditorialModel')
22 22
 class EmField(EmComponent):
23 23
 
24 24
     table = 'em_field'
25
+    ranked_in = 'fieldgroup_id'
25 26
     _fields = [
26 27
         ('fieldtype', EmField_char),
27 28
         ('fieldgroup_id', EmField_integer),

+ 1
- 0
EditorialModel/types.py View File

@@ -18,6 +18,7 @@ import EditorialModel.classes
18 18
 # @see EditorialModel::components::EmComponent
19 19
 class EmType(EmComponent):
20 20
     table = 'em_type'
21
+    ranked_in = 'class_id'
21 22
 
22 23
     ## @brief Specific EmClass fields
23 24
     # @see EditorialModel::components::EmComponent::_fields

Loading…
Cancel
Save