Browse Source

Deleted comments and bugfix on EmFieldGroup.fields()

Yann Weber 9 years ago
parent
commit
eb69492363
1 changed files with 1 additions and 27 deletions
  1. 1
    27
      EditorialModel/fieldgroups.py

+ 1
- 27
EditorialModel/fieldgroups.py View File

@@ -27,24 +27,6 @@ class EmFieldGroup(EmComponent):
27 27
     def __init__(self, data, model):
28 28
         super(EmFieldGroup, self).__init__(data, model)
29 29
 
30
-    # @classmethod
31
-    ## Create a new EmFieldGroup
32
-    #
33
-    # Save it in database and return an instance*
34
-    # @param **em_component_args : @ref EditorialModel::components::create(), must contain fields "name" (str) and "class" (EmClass)
35
-    # @throw EmComponentExistError If an EmFieldGroup with this name allready exists
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)
47
-
48 30
     ## Deletes a fieldgroup
49 31
     #
50 32
     # @return True if the deletion is a success, False if not
@@ -60,18 +42,10 @@ class EmFieldGroup(EmComponent):
60 42
     # @return A list of EmField instance
61 43
     def fields(self):
62 44
         result = []
63
-        for _, field in self.model.components(EmField):
45
+        for field in self.model.components(EmField):
64 46
             if field.fieldgroup_id == self.uid:
65 47
                 result.append(field)
66 48
         return result
67
-        # meta = sqlutils.meta(self.db_engine)
68
-        # field_table = sql.Table(EditorialModel.fields.EmField.table, meta)
69
-        # req = field_table.select(field_table.c.uid).where(field_table.c.fieldgroup_id == self.uid)
70
-        # conn = self.db_engine.connect()
71
-        # res = conn.execute(req)
72
-        # rows = res.fetchall()
73
-        # conn.close()
74
-        # return [EditorialModel.fields.EmField(row['uid']) for row in rows]
75 49
 
76 50
 class NotEmptyError(Exception):
77 51
     pass

Loading…
Cancel
Save