Browse Source

[#69] "parent" nature is now taken from EditorialModel.classtypes.EmNature

Roland Haroutiounian 9 years ago
parent
commit
1e8e10b569
1 changed files with 3 additions and 3 deletions
  1. 3
    3
      leobject/datasources/ledatasourcesql.py

+ 3
- 3
leobject/datasources/ledatasourcesql.py View File

14
 import mosql.mysql
14
 import mosql.mysql
15
 
15
 
16
 from DataSource.MySQL.MySQL import MySQL
16
 from DataSource.MySQL.MySQL import MySQL
17
-
17
+from EditorialModel.classtypes import EmNature
18
 
18
 
19
 ## MySQL DataSource for LeObject
19
 ## MySQL DataSource for LeObject
20
 class LeDataSourceSQL(DummyDatasource):
20
 class LeDataSourceSQL(DummyDatasource):
423
             cur.execute('SELECT last_insert_id()')
423
             cur.execute('SELECT last_insert_id()')
424
             relation_id, = cur.fetchone()
424
             relation_id, = cur.fetchone()
425
 
425
 
426
-        if nature == 'parent':
426
+        if nature == EmNature.PARENT:
427
             parent_superiors = lesup.superiors()
427
             parent_superiors = lesup.superiors()
428
             for superior in parent_superiors:
428
             for superior in parent_superiors:
429
                 depth = depth - 1 if depth is not None else 1
429
                 depth = depth - 1 if depth is not None else 1
430
-                self.add_relation(lesup=superior.lodel_id, lesub=lesub.lodel_id, nature='parent', depth=depth, rank=rank)
430
+                self.add_relation(lesup=superior.lodel_id, lesub=lesub.lodel_id, nature=EmNature.PARENT, depth=depth, rank=rank)
431
 
431
 
432
         return relation_id
432
         return relation_id
433
 
433
 

Loading…
Cancel
Save