浏览代码

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

Roland Haroutiounian 9 年前
父节点
当前提交
1e8e10b569
共有 1 个文件被更改,包括 3 次插入3 次删除
  1. 3
    3
      leobject/datasources/ledatasourcesql.py

+ 3
- 3
leobject/datasources/ledatasourcesql.py 查看文件

@@ -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
 

正在加载...
取消
保存