|
@@ -12,7 +12,9 @@ import logging
|
12
|
12
|
|
13
|
13
|
logger = logging.getLogger('Lodel2.EditorialModel')
|
14
|
14
|
|
15
|
|
-"""Represent one data for a lodel2 document"""
|
|
15
|
+## EmField (Class)
|
|
16
|
+#
|
|
17
|
+# Represents one data for a lodel2 document
|
16
|
18
|
class EmField(EmComponent):
|
17
|
19
|
|
18
|
20
|
table = 'em_field'
|
|
@@ -78,7 +80,7 @@ class EmField(EmComponent):
|
78
|
80
|
# @param emField EmField: the object representing the field
|
79
|
81
|
# @return True in case of success, False if not
|
80
|
82
|
@classmethod
|
81
|
|
- def addFieldColumnToClassTable(cls, emField):
|
|
83
|
+ def addFieldColumnToClassTable(c, emField):
|
82
|
84
|
field_type = EditorialModel.fieldtypes.get_field_type(emField.em_fieldtype)
|
83
|
85
|
field_sqlalchemy_args = field_type.sqlalchemy_args()
|
84
|
86
|
field_sqlalchemy_args['name'] = emField.name
|
|
@@ -111,7 +113,7 @@ class EmField(EmComponent):
|
111
|
113
|
query_builder.From(uidtable)
|
112
|
114
|
query_builder.Where('uids.uid=%s' % self.uid)
|
113
|
115
|
|
114
|
|
- records = query.Execute().fetchall()
|
|
116
|
+ records = query_builder.Execute().fetchall()
|
115
|
117
|
table_records = []
|
116
|
118
|
for record in records:
|
117
|
119
|
table_records.append(dict(zip(record.keys(), record)))
|
|
@@ -155,5 +157,3 @@ class EmField(EmComponent):
|
155
|
157
|
|
156
|
158
|
return super(EmField, self).save(values)
|
157
|
159
|
|
158
|
|
-class EmFieldNotExistError(Exception):
|
159
|
|
- pass
|