forgot to added context_processors.py
This commit is contained in:
parent
4ead83b483
commit
71fffbdf6a
12
itf/frontpage/context_processors.py
Normal file
12
itf/frontpage/context_processors.py
Normal 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}
|
Loading…
Reference in New Issue
Block a user