From e22c482d52438d555db6c1757fda75400414e281 Mon Sep 17 00:00:00 2001 From: Sanj Date: Wed, 10 Aug 2011 01:00:07 +0530 Subject: [PATCH] added context processor for menu items --- itf/frontpage/views.py | 11 +---------- itf/settings.py | 1 + 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/itf/frontpage/views.py b/itf/frontpage/views.py index 477e1a0..b987d6e 100644 --- a/itf/frontpage/views.py +++ b/itf/frontpage/views.py @@ -12,16 +12,7 @@ def index(request): except: statuses = [] boxes = SliderBox.objects.all() - 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 render_to_response("noel/index.html", RequestContext(request, { 'tweets': statuses[0:5], - 'boxes': boxes, - 'menus': menus + 'boxes': boxes })) diff --git a/itf/settings.py b/itf/settings.py index fdab69c..cde37cf 100644 --- a/itf/settings.py +++ b/itf/settings.py @@ -85,6 +85,7 @@ TEMPLATE_CONTEXT_PROCESSORS = ( "django.core.context_processors.i18n", "django.core.context_processors.media", "multilingual.context_processors.multilingual", + "frontpage.context_processors.menus" ) # URL that handles the media served from MEDIA_ROOT. Make sure to use a