1 from content.models import Document, Folder
4 def content_menu(request):
5 items = Document.objects.filter(folder__isnull=True, islive__exact=True)
8 if item.slug != 'index':
12 'url': item.get_basic_url(),
15 folders = Folder.objects.filter(folder__isnull=True)
16 for folder in folders:
18 item = Document.objects.filter(folder__exact=folder, islive__exact=True, slug__exact='index')
21 'title': folder.title,
22 'url': folder.get_basic_url(),
28 menu_items.sort(cmp=lambda x,y: cmp(x['title'].lower(), y['title'].lower()))
31 'content_menu': menu_items,