From 71fffbdf6a477b27f9ba0b0ad3653c437fa184cd Mon Sep 17 00:00:00 2001 From: Sanj Date: Wed, 10 Aug 2011 17:10:16 +0530 Subject: [PATCH] forgot to added context_processors.py --- itf/frontpage/context_processors.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 itf/frontpage/context_processors.py diff --git a/itf/frontpage/context_processors.py b/itf/frontpage/context_processors.py new file mode 100644 index 0000000..b42de56 --- /dev/null +++ b/itf/frontpage/context_processors.py @@ -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}