def menu(app=None): if app == 'topic': from nnmware.apps.topic.models import TopicCategory as MenuCategory elif app == 'board': from nnmware.apps.board.models import BoardCategory as MenuCategory elif app == 'shop': from nnmware.apps.shop.models import ProductCategory as MenuCategory elif app == 'article': from nnmware.apps.publication.models import PublicationCategory as MenuCategory else: pass if 1 > 0: # try: html = Element("ul") for node in MenuCategory.objects.all(): if not node.parent: recurse_for_children(node, html) return tostring(html, 'utf-8')
def category_tree_series(): root = Element("ul") for cats in Tree.objects.all().filter(slug='series'): if not cats.parent: recurse_for_children(cats, root) return tostring(root, 'utf-8')
def category_tree_series(): root = Element("ul") for cats in Tree.objects.all().filter(slug='series'): if not cats.parent: recurse_for_children(cats, root) return tostring(root, 'unicode')