From b2d5aef1ff976b017ad6878266771375404c6c64 Mon Sep 17 00:00:00 2001 From: Antonio de la Rosa Date: Thu, 22 Jun 2017 05:03:57 +0200 Subject: [PATCH] Fix in hiearchy model links --- paramecio/citoplasma/hierarchy_links.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/paramecio/citoplasma/hierarchy_links.py b/paramecio/citoplasma/hierarchy_links.py index cad30c1..0e31887 100644 --- a/paramecio/citoplasma/hierarchy_links.py +++ b/paramecio/citoplasma/hierarchy_links.py @@ -90,7 +90,7 @@ class HierarchyModelLinks: 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: if self.field_parent not in self.arr_parent: self.arr_parent[arr_model[self.model.name_field_id]]=[] @@ -120,6 +120,13 @@ class HierarchyModelLinks: 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.arr_son.insert(0, self.url(0, self.first_element_title))