Roland Haroutiounian 9 years ago
parent
commit
501ee8f0ea
2 changed files with 8 additions and 9 deletions
  1. 2
    3
      EditorialModel/classes.py
  2. 6
    6
      EditorialModel/fields_types.py

+ 2
- 3
EditorialModel/classes.py View File

@@ -59,8 +59,7 @@ class EmClass(EmComponent):
59 59
 
60 60
         #Create a new table storing LodelObjects of this EmClass
61 61
         meta = sql.MetaData()
62
-        emclasstable = sql.Table(name, meta,
63
-            sql.Column('uid', sql.VARCHAR(50), primary_key=True))
62
+        emclasstable = sql.Table(name, meta, sql.Column('uid', sql.VARCHAR(50), primary_key=True))
64 63
         emclasstable.create(conn)
65 64
 
66 65
         conn.close()
@@ -169,7 +168,7 @@ class EmClass(EmComponent):
169 168
         meta = sql.MetaData()
170 169
         meta.reflect(dbe)
171 170
 
172
-        linked_types=[]
171
+        linked_types = []
173 172
         for table in meta.tables.values():
174 173
             table_name_elements = table.name.split('_')
175 174
             if len(table_name_elements) == 2:

+ 6
- 6
EditorialModel/fields_types.py View File

@@ -47,11 +47,11 @@ class Em_Field_Type(object):
47 47
             'field_id': em_field.uid
48 48
         }
49 49
 
50
-        created_relation = Em_Field_Type._createDb(**values)
50
+        created_relation = Em_Field_Type._create_db(**values)
51 51
         return created_relation
52 52
 
53 53
     @classmethod
54
-    def _createDb(cls, **kwargs):
54
+    def _create_db(cls, **kwargs):
55 55
         dbe = EmComponent.db_engine()
56 56
         conn = dbe.connect()
57 57
         table = sqla.Table(cls.table, sqlutils.meta(dbe))
@@ -66,9 +66,9 @@ class Em_Field_Type(object):
66 66
     #
67 67
     # @return Boolean
68 68
     def delete(self):
69
-        return self._deleteDb()
69
+        return self._delete_db()
70 70
 
71
-    def _deleteDb(self):
71
+    def _delete_db(self):
72 72
         dbe = EmComponent.db_engine()
73 73
         table = sqla.Table(self.table, sqlutils.meta(dbe))
74 74
         req = table.delete().where(table.c.type_id == self.type_id).where(table.c.field_id == self.field_id)
@@ -88,14 +88,14 @@ class Em_Field_Type(object):
88 88
     #
89 89
     # @return True if success, False if failure
90 90
     def exists(self):
91
-        return self._existsDb()
91
+        return self._exists_db()
92 92
 
93 93
     ## _ExistsDb (Function)
94 94
     #
95 95
     # Queries the database to see if a relation exists or not
96 96
     #
97 97
     # @return True if success, False if failure
98
-    def _existsDb(self):
98
+    def _exists_db(self):
99 99
         dbe = EmComponent.db_engine()
100 100
         table = sqla.Table(self.table, sqlutils.meta(dbe))
101 101
         req = table.select().where(table.c.type_id == self.type_id).where(table.c.field_id == self.field_id)

Loading…
Cancel
Save