Pārlūkot izejas kodu

[#69] Dealing with all kind of natures and not only "parent" (in LeDataSourceSQL.add_superior)

Roland Haroutiounian 9 gadus atpakaļ
vecāks
revīzija
69306a9357
1 mainītis faili ar 2 papildinājumiem un 2 dzēšanām
  1. 2
    2
      leobject/datasources/ledatasourcesql.py

+ 2
- 2
leobject/datasources/ledatasourcesql.py Parādīt failu

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 == EmNature.PARENT:
426
+        if nature in EmNature.getall():
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=EmNature.PARENT, depth=depth, rank=rank)
430
+                self.add_relation(lesup=superior.lodel_id, lesub=lesub.lodel_id, nature=nature, depth=depth, rank=rank)
431
 
431
 
432
         return relation_id
432
         return relation_id
433
 
433
 

Notiek ielāde…
Atcelt
Saglabāt