|
@@ -5,7 +5,6 @@
|
5
|
5
|
|
6
|
6
|
from EditorialModel.components import EmComponent
|
7
|
7
|
from EditorialModel.classtypes import EmClassType
|
8
|
|
-from EditorialModel.types import EmType
|
9
|
8
|
#from EditorialModel.exceptions import *
|
10
|
9
|
#import EditorialModel.fieldtypes as ftypes
|
11
|
10
|
import EditorialModel
|
|
@@ -13,7 +12,7 @@ import EditorialModel
|
13
|
12
|
|
14
|
13
|
## @brief Manipulate Classes of the Editorial Model
|
15
|
14
|
# Create classes of object.
|
16
|
|
-# @see EmClass, EmType, EditorialModel.fieldgroups.EmFieldGroup, EmField
|
|
15
|
+# @see EmClass, EditorialModel.types.EmType, EditorialModel.fieldgroups.EmFieldGroup, EmField
|
17
|
16
|
# @todo sortcolumn handling
|
18
|
17
|
class EmClass(EmComponent):
|
19
|
18
|
|
|
@@ -44,7 +43,7 @@ class EmClass(EmComponent):
|
44
|
43
|
# If a class has no fieldgroups delete it
|
45
|
44
|
# @return bool : True if deleted False if deletion aborded
|
46
|
45
|
def delete_check(self):
|
47
|
|
- for emtype in self.model.components(EmType):
|
|
46
|
+ for emtype in self.model.components(EditorialModel.types.EmType):
|
48
|
47
|
if emtype.class_id == self.uid:
|
49
|
48
|
return False
|
50
|
49
|
for fieldgroup in self.model.components(EditorialModel.fieldgroups.EmFieldGroup):
|
|
@@ -76,21 +75,21 @@ class EmClass(EmComponent):
|
76
|
75
|
return fields
|
77
|
76
|
|
78
|
77
|
## Retrieve list of type of this class
|
79
|
|
- # @return types [EmType]:
|
|
78
|
+ # @return types [EditorialModel.types.EmType]:
|
80
|
79
|
def types(self):
|
81
|
80
|
ret = []
|
82
|
|
- for emtype in self.model.components(EmType):
|
|
81
|
+ for emtype in self.model.components(EditorialModel.types.EmType):
|
83
|
82
|
if emtype.class_id == self.uid:
|
84
|
83
|
ret.append(emtype)
|
85
|
84
|
return ret
|
86
|
85
|
|
87
|
|
- ## Add a new EmType that can ben linked to this class
|
88
|
|
- # @param em_type EmType: type to link
|
|
86
|
+ ## Add a new EditorialModel.types.EmType that can ben linked to this class
|
|
87
|
+ # @param em_type EditorialModel.types.EmType: type to link
|
89
|
88
|
# @return success bool: done or not
|
90
|
89
|
def link_type(self, em_type):
|
91
|
90
|
pass
|
92
|
91
|
|
93
|
|
- ## Retrieve list of EmType that are linked to this class
|
94
|
|
- # @return types [EmType]:
|
|
92
|
+ ## Retrieve list of EditorialModel.types.EmType that are linked to this class
|
|
93
|
+ # @return types [EditorialModel.types.EmType]:
|
95
|
94
|
def linked_types(self):
|
96
|
95
|
pass
|