Browse Source

[EmFieldGroup] Changed the create method of the class

Roland Haroutiounian 9 years ago
parent
commit
129ba00c41
1 changed files with 7 additions and 4 deletions
  1. 7
    4
      EditorialModel/fieldgroups.py

+ 7
- 4
EditorialModel/fieldgroups.py View File

@@ -35,13 +35,16 @@ class EmFieldGroup(EmComponent):
35 35
     # @param **em_component_args : @ref EditorialModel::components::create()
36 36
     # @throw EmComponentExistError If an EmFieldGroup with this name allready exists
37 37
     # @throw TypeError If an argument is of an unexepted type
38
-    def create(cls, name, em_class, **em_component_args):
38
+    def create(cls, **em_component_args):
39
+        fieldgroup_name = em_component_args['name']
40
+        fieldgroup_class = em_component_args['class']
41
+
39 42
         if not isinstance(name, str):
40
-            raise TypeError("Excepting <class str> as name. But got %s" % str(type(name)))
43
+            raise TypeError("Excepting <class str> as name. But got %s" % str(type(fielgroup_name)))
41 44
         if not isinstance(em_class, EmClass):
42
-            raise TypeError("Excepting <class EmClass> as em_class. But got %s" % str(type(name)))
45
+            raise TypeError("Excepting <class EmClass> as em_class. But got %s" % str(type(fieldgroup_class)))
43 46
 
44
-        return super(EmFieldGroup, cls).create(name=name, class_id=em_class.uid, **em_component_args)
47
+        return super(EmFieldGroup, cls).create(**em_component_args)
45 48
 
46 49
     ## Get the list of associated fields
47 50
     # @return A list of EmField instance

Loading…
Cancel
Save