# Path: gitcms/menus/models.py
# class Menu(models.Model):
#     name = models.CharField(tr('Name'), max_length=255)
#     fake_root = models.ForeignKey(MenuItem)
#     def _get_children(self):
#         return self.fake_root.children.all()
#     children = property(_get_children)


from django import template
from gitcms.menus.models import Menu
register = template.Library()


@register.inclusion_tag('menus/menu.html')
def show_menu(menu_name):
    menu = Menu.objects.get(name=menu_name)
    return { 'items' : menu.children }

@register.inclusion_tag('menus/tabs.html')
def show_tabs(menu_name):

# Path: gitcms/menus/models.py
# class Menu(models.Model):
#     name = models.CharField(tr('Name'), max_length=255)
#     fake_root = models.ForeignKey(MenuItem)
#     def _get_children(self):
#         return self.fake_root.children.all()
#     children = property(_get_children)


# Path: gitcms/menus/templatetags/menus_tags.py
from django import template
from gitcms.menus.models import Menu

register = template.Library()


@register.inclusion_tag('menus/menu.html')
def show_menu(menu_name):
    menu = Menu.objects.get(name=menu_name)
    return { 'items' : menu.children }

@register.inclusion_tag('menus/tabs.html')
def show_tabs(menu_name):

    menu = Menu.objects.get(name=menu_name)