|
@@ -27,23 +27,23 @@ class EmFieldGroup(EmComponent):
|
27
|
27
|
def __init__(self, data, model):
|
28
|
28
|
super(EmFieldGroup, self).__init__(data, model)
|
29
|
29
|
|
30
|
|
- @classmethod
|
|
30
|
+ # @classmethod
|
31
|
31
|
## Create a new EmFieldGroup
|
32
|
32
|
#
|
33
|
33
|
# Save it in database and return an instance*
|
34
|
34
|
# @param **em_component_args : @ref EditorialModel::components::create(), must contain fields "name" (str) and "class" (EmClass)
|
35
|
35
|
# @throw EmComponentExistError If an EmFieldGroup with this name allready exists
|
36
|
36
|
# @throw TypeError If an argument is of an unexepted type
|
37
|
|
- def create(cls, **em_component_args):
|
38
|
|
- fieldgroup_name = em_component_args['name']
|
39
|
|
- fieldgroup_class = em_component_args['class']
|
40
|
|
-
|
41
|
|
- if not isinstance(fieldgroup_name, str):
|
42
|
|
- raise TypeError("Excepting <class str> as name. But got %s" % str(type(fieldgroup_name)))
|
43
|
|
- if not isinstance(fieldgroup_class, EmClass):
|
44
|
|
- raise TypeError("Excepting <class EmClass> as em_class. But got %s" % str(type(fieldgroup_class)))
|
45
|
|
-
|
46
|
|
- return super(EmFieldGroup, cls).create(**em_component_args)
|
|
37
|
+ # def create(cls, **em_component_args):
|
|
38
|
+ # fieldgroup_name = em_component_args['name']
|
|
39
|
+ # fieldgroup_class = em_component_args['class']
|
|
40
|
+ #
|
|
41
|
+ # if not isinstance(fieldgroup_name, str):
|
|
42
|
+ # raise TypeError("Excepting <class str> as name. But got %s" % str(type(fieldgroup_name)))
|
|
43
|
+ # if not isinstance(fieldgroup_class, EmClass):
|
|
44
|
+ # raise TypeError("Excepting <class EmClass> as em_class. But got %s" % str(type(fieldgroup_class)))
|
|
45
|
+ #
|
|
46
|
+ # return super(EmFieldGroup, cls).create(**em_component_args)
|
47
|
47
|
|
48
|
48
|
## Deletes a fieldgroup
|
49
|
49
|
#
|