Fix in hiearchy model links
This commit is contained in:
parent
35b0eda95a
commit
b2d5aef1ff
1 changed files with 8 additions and 1 deletions
|
|
@ -90,7 +90,7 @@ class HierarchyModelLinks:
|
||||||
|
|
||||||
def prepare(self):
|
def prepare(self):
|
||||||
|
|
||||||
with self.model.select([self.model.name_field_id, self.field_name, self.field_parent]) as cur:
|
with self.model.set_conditions('', []).select([self.model.name_field_id, self.field_name, self.field_parent]) as cur:
|
||||||
for arr_model in cur:
|
for arr_model in cur:
|
||||||
if self.field_parent not in self.arr_parent:
|
if self.field_parent not in self.arr_parent:
|
||||||
self.arr_parent[arr_model[self.model.name_field_id]]=[]
|
self.arr_parent[arr_model[self.model.name_field_id]]=[]
|
||||||
|
|
@ -120,6 +120,13 @@ class HierarchyModelLinks:
|
||||||
|
|
||||||
def show(self, son_id, separator=' >> '):
|
def show(self, son_id, separator=' >> '):
|
||||||
|
|
||||||
|
try:
|
||||||
|
son_id=int(son_id)
|
||||||
|
except:
|
||||||
|
son_id=0
|
||||||
|
|
||||||
|
self.prepare()
|
||||||
|
|
||||||
self.parents(son_id, self.no_url)
|
self.parents(son_id, self.no_url)
|
||||||
|
|
||||||
self.arr_son.insert(0, self.url(0, self.first_element_title))
|
self.arr_son.insert(0, self.url(0, self.first_element_title))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue