Browse Source

[#11] Implémentation du _fields dans EmField

Roland Haroutiounian 9 years ago
parent
commit
c017ae793e
1 changed files with 11 additions and 0 deletions
  1. 11
    0
      EditorialModel/fields.py

+ 11
- 0
EditorialModel/fields.py View File

@@ -1,6 +1,7 @@
1 1
 #-*- coding: utf-8 -*-
2 2
 
3 3
 from EditorialModel.components import EmComponent, EmComponentNotExistError
4
+from EditorialModel.fieldtypes import *
4 5
 from Database import sqlutils
5 6
 from Database.sqlwrapper import SqlWrapper
6 7
 from Database.sqlquerybuilder import SqlQueryBuilder
@@ -18,6 +19,15 @@ logger = logging.getLogger('Lodel2.EditorialModel')
18 19
 class EmField(EmComponent):
19 20
 
20 21
     table = 'em_field'
22
+    _fields = [
23
+        ('fieldtype', EmField_char()),
24
+        ('fieldgroup_id', EmField_integer()),
25
+        ('rel_to_type_id', EmField_integer()),
26
+        ('rel_field_id', EmField_integer()),
27
+        ('optional', EmField_boolean()),
28
+        ('internal', EmField_boolean()),
29
+        ('icon', EmField_integer())
30
+    ]
21 31
 
22 32
     ## __init__ (Function)
23 33
     #
@@ -28,6 +38,7 @@ class EmField(EmComponent):
28 38
     # @see EmComponent::__init__()
29 39
     def __init__(self, id_or_name):
30 40
         self.table = EmField.table
41
+        self._fields = self.__class__._fields
31 42
         super(EmField, self).__init__(id_or_name)
32 43
 
33 44
     ## Create (Function)

Loading…
Cancel
Save