Browse Source

PEP8 / PyLint on classes.py

Roland Haroutiounian 9 years ago
parent
commit
5d43d897e1
1 changed files with 6 additions and 7 deletions
  1. 6
    7
      EditorialModel/classes.py

+ 6
- 7
EditorialModel/classes.py View File

17
 class EmClass(EmComponent):
17
 class EmClass(EmComponent):
18
 
18
 
19
     ranked_in = 'classtype'
19
     ranked_in = 'classtype'
20
-    
20
+
21
     ## EmClass instanciation
21
     ## EmClass instanciation
22
     # @todo Classtype initialisation and test is not good EmClassType should give an answer or something like that
22
     # @todo Classtype initialisation and test is not good EmClassType should give an answer or something like that
23
     # @todo defines types check for icon and sortcolumn
23
     # @todo defines types check for icon and sortcolumn
39
             if fname not in [f.name for f in self.fields()]:
39
             if fname not in [f.name for f in self.fields()]:
40
                 self.model.add_default_class_fields(self.uid)
40
                 self.model.add_default_class_fields(self.uid)
41
         super(EmClass, self).check()
41
         super(EmClass, self).check()
42
-    
42
+
43
     ## @brief Return the default fields list for this EmClass
43
     ## @brief Return the default fields list for this EmClass
44
     # @return a dict with key = fieldname and value is a dict to pass to the EditorialModel::model::Model::creat_component() method
44
     # @return a dict with key = fieldname and value is a dict to pass to the EditorialModel::model::Model::creat_component() method
45
     def default_fields_list(self):
45
     def default_fields_list(self):
46
         ctype = EditorialModel.classtypes.EmClassType.get(self.classtype)
46
         ctype = EditorialModel.classtypes.EmClassType.get(self.classtype)
47
         res = ctype['default_fields']
47
         res = ctype['default_fields']
48
-        for k,v in EditorialModel.classtypes.common_fields.items():
48
+        for k, v in EditorialModel.classtypes.common_fields.items():
49
             res[k] = copy.copy(v)
49
             res[k] = copy.copy(v)
50
         return res
50
         return res
51
-        
52
 
51
 
53
     ## @brief Delete a class if it's ''empty''
52
     ## @brief Delete a class if it's ''empty''
54
     # If a class has no fieldgroups delete it
53
     # If a class has no fieldgroups delete it
73
 
72
 
74
     ## Retrieve list of fields
73
     ## Retrieve list of fields
75
     # @return fields [EmField]:
74
     # @return fields [EmField]:
76
-    def fields(self, relational = True):
75
+    def fields(self, relational=True):
77
         if relational:
76
         if relational:
78
-            return [ f for f in self.model.components('EmField') if f.class_id == self.uid]
77
+            return [f for f in self.model.components('EmField') if f.class_id == self.uid]
79
         else:
78
         else:
80
-            return [ f for f in self.model.components('EmField') if f.class_id == self.uid and f.fieldtype != 'rel2type' and f.rel_field_id is None]
79
+            return [f for f in self.model.components('EmField') if f.class_id == self.uid and f.fieldtype != 'rel2type' and f.rel_field_id is None]
81
 
80
 
82
     ## Retrieve list of type of this class
81
     ## Retrieve list of type of this class
83
     # @return types [EditorialModel.types.EmType]:
82
     # @return types [EditorialModel.types.EmType]:

Loading…
Cancel
Save