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
 #-*- coding: utf-8 -*-
1
 #-*- coding: utf-8 -*-
2
 
2
 
3
 from EditorialModel.components import EmComponent, EmComponentNotExistError
3
 from EditorialModel.components import EmComponent, EmComponentNotExistError
4
+from EditorialModel.fieldtypes import *
4
 from Database import sqlutils
5
 from Database import sqlutils
5
 from Database.sqlwrapper import SqlWrapper
6
 from Database.sqlwrapper import SqlWrapper
6
 from Database.sqlquerybuilder import SqlQueryBuilder
7
 from Database.sqlquerybuilder import SqlQueryBuilder
18
 class EmField(EmComponent):
19
 class EmField(EmComponent):
19
 
20
 
20
     table = 'em_field'
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
     ## __init__ (Function)
32
     ## __init__ (Function)
23
     #
33
     #
28
     # @see EmComponent::__init__()
38
     # @see EmComponent::__init__()
29
     def __init__(self, id_or_name):
39
     def __init__(self, id_or_name):
30
         self.table = EmField.table
40
         self.table = EmField.table
41
+        self._fields = self.__class__._fields
31
         super(EmField, self).__init__(id_or_name)
42
         super(EmField, self).__init__(id_or_name)
32
 
43
 
33
     ## Create (Function)
44
     ## Create (Function)

Loading…
Cancel
Save