13 lines
351 B
Python
13 lines
351 B
Python
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}
|