diff options
Diffstat (limited to 'ishtar_common/menu_base.py')
-rw-r--r-- | ishtar_common/menu_base.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/ishtar_common/menu_base.py b/ishtar_common/menu_base.py index 7913bd470..13eb46f99 100644 --- a/ishtar_common/menu_base.py +++ b/ishtar_common/menu_base.py @@ -23,13 +23,19 @@ from ishtar_common.models import get_current_profile class SectionItem: def __init__(self, idx, label, childs=[], profile_restriction=None, css=''): self.idx = idx - self.label = label + self._label = label self.childs = childs self.available = False self.items = {} self.profile_restriction = profile_restriction self.css = css + @property + def label(self): + if callable(self._label): + return self._label() + return self._label + def check_profile_restriction(self): if self.profile_restriction: profile = get_current_profile() |