|
@@ -14,7 +14,7 @@ from mosql.util import raw, or_
|
14
|
14
|
import mosql.mysql
|
15
|
15
|
|
16
|
16
|
from DataSource.MySQL.MySQL import MySQL
|
17
|
|
-
|
|
17
|
+from EditorialModel.classtypes import EmNature
|
18
|
18
|
|
19
|
19
|
## MySQL DataSource for LeObject
|
20
|
20
|
class LeDataSourceSQL(DummyDatasource):
|
|
@@ -423,11 +423,11 @@ class LeDataSourceSQL(DummyDatasource):
|
423
|
423
|
cur.execute('SELECT last_insert_id()')
|
424
|
424
|
relation_id, = cur.fetchone()
|
425
|
425
|
|
426
|
|
- if nature == 'parent':
|
|
426
|
+ if nature == EmNature.PARENT:
|
427
|
427
|
parent_superiors = lesup.superiors()
|
428
|
428
|
for superior in parent_superiors:
|
429
|
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
|
432
|
return relation_id
|
433
|
433
|
|