From 8e0daedce7305de901a67c6750a91e91fcaaca69 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Mon, 26 Feb 2018 18:32:14 +0100 Subject: Manage hierarchical help text message for types (refs #3759) --- ishtar_common/models.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'ishtar_common/models.py') diff --git a/ishtar_common/models.py b/ishtar_common/models.py index 7798c722d..923d0bb31 100644 --- a/ishtar_common/models.py +++ b/ishtar_common/models.py @@ -516,8 +516,18 @@ class GeneralType(Cached, models.Model): help_items = u"\n" for item in cls.get_types(dct=dct, instances=True, exclude=exclude): if hasattr(item, '__iter__'): - # TODO: manage multiple levels - continue + pk = item[0] + item = cls.objects.get(pk=pk) + item.rank = c_rank + 1 + if hasattr(item, 'parent'): + c_item = item + parents = [] + while c_item.parent: + parents.append(c_item.parent.label) + c_item = c_item.parent + parents.reverse() + parents.append(item.label) + item.label = u" / ".join(parents) if not item.comment: continue if c_rank > item.rank: -- cgit v1.2.3