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

Loading…
Cancel
Save