forgot to added context_processors.py

This commit is contained in:
Sanj 2011-08-10 17:10:16 +05:30
parent 4ead83b483
commit 71fffbdf6a

View File

@ -0,0 +1,12 @@
from frontpage.models import MenuHeading, MenuItem
def menus(request):
menuHeads = MenuHeading.objects.all()
menus = []
for m in menuHeads:
d = {
'name': m.name,
'items': [{'name': item.name, 'url': item.url} for item in m.menuitem_set.all()]
}
menus.append(d)
return {'menus': menus}