Browse Source

[EmType] pep8 + pylint

Roland Haroutiounian 9 years ago
parent
commit
89d45ab799
1 changed files with 9 additions and 7 deletions
  1. 9
    7
      EditorialModel/types.py

+ 9
- 7
EditorialModel/types.py View File

@@ -1,11 +1,11 @@
1 1
 #-*- coding: utf-8 -*-
2 2
 
3
-from Database import sqlutils
4
-import sqlalchemy as sql
3
+# from Database import sqlutils
4
+# import sqlalchemy as sql
5 5
 
6 6
 import EditorialModel
7 7
 from EditorialModel.components import EmComponent
8
-from EditorialModel.fieldgroups import EmFieldGroup
8
+# from EditorialModel.fieldgroups import EmFieldGroup
9 9
 from EditorialModel.fields import EmField
10 10
 from EditorialModel.classtypes import EmClassType
11 11
 import EditorialModel.fieldtypes as ftypes
@@ -30,7 +30,7 @@ class EmType(EmComponent):
30 30
         ('class_id', ftypes.EmField_integer),
31 31
         ('icon', ftypes.EmField_icon),
32 32
         ('sortcolumn', ftypes.EmField_char)
33
-        ]
33
+    ]
34 34
 
35 35
     @classmethod
36 36
     ## Create a new EmType and instanciate it
@@ -51,6 +51,7 @@ class EmType(EmComponent):
51 51
     # @todo Don't hardcode table name
52 52
     def _table_hierarchy(self):
53 53
         # TODO Réimplémenter
54
+        pass
54 55
         #return sql.Table(self.__class__.table_hierarchy, sqlutils.meta(self.db_engine))
55 56
 
56 57
     @property
@@ -79,7 +80,7 @@ class EmType(EmComponent):
79 80
     # @return A list of EmFieldGroup instance
80 81
     def field_groups(self):
81 82
         # TODO Réimplémenter
82
-
83
+        pass
83 84
         # meta = sqlutils.meta(self.db_engine)
84 85
         # fg_table = sql.Table(EmFieldGroup.table, meta)
85 86
         # req = fg_table.select(fg_table.c.uid).where(fg_table.c.class_id == self.class_id)
@@ -102,7 +103,7 @@ class EmType(EmComponent):
102 103
     # @return A list of EmField instance
103 104
     def selected_fields(self):
104 105
         # TODO Réimplémenter
105
-
106
+        pass
106 107
         # dbe = self.db_engine
107 108
         # meta = sqlutils.meta(dbe)
108 109
         # conn = dbe.connect()
@@ -154,7 +155,7 @@ class EmType(EmComponent):
154 155
     #
155 156
     # @throw TypeError if field is not an EmField instance
156 157
     # @throw ValueError if field is not optional or is not associated with this type
157
-    def _opt_field_act(self, field, select=True):
158
+    def _opt_field_act(self, field, select=True):  # TODO voir si on conserve l'argument "select"
158 159
         if not isinstance(field, EmField):
159 160
             raise TypeError("Excepted <class EmField> as field argument. But got " + str(type(field)))
160 161
         if not field in self.all_fields():
@@ -226,6 +227,7 @@ class EmType(EmComponent):
226 227
     # @see EmType::subordinates(), EmType::superiors()
227 228
     def _sub_or_sup(self, sup=True):
228 229
         # TODO Réimplémenter
230
+        pass
229 231
         # conn = self.db_engine.connect()
230 232
         # htable = self._table_hierarchy
231 233
         # type_table = sqlutils.get_table(self)

Loading…
Cancel
Save