diff options
Diffstat (limited to 'ishtar_common/models.py')
| -rw-r--r-- | ishtar_common/models.py | 14 | 
1 files changed, 12 insertions, 2 deletions
| 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: | 
