X-Git-Url: https://git.mdrn.pl/prawokultury.git/blobdiff_plain/d57cb0586003722ceca5c06519d3225686566a78..a20146248fcfa1c17416ccf3c97277f656242158:/prawokultury/menu_items.py diff --git a/prawokultury/menu_items.py b/prawokultury/menu_items.py index eb3f766..1da9c69 100644 --- a/prawokultury/menu_items.py +++ b/prawokultury/menu_items.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 from migdal.models import Category, Entry from menu.helpers import ObjectMenuItem, MenuItem, ModelMenuItem from django.core.urlresolvers import reverse_lazy @@ -6,24 +7,24 @@ from django.utils.translation import ugettext_lazy as _ ITEMS = [] -def add_entry(**qs): - try: - entry = Entry.objects.get(**qs) - except Entry.DoesNotExist: - return - if not entry.published: - return - ITEMS.append(ObjectMenuItem(entry)) - -add_entry(slug_pl='o-nas') +ITEMS.append(ObjectMenuItem( + obj_get=lambda:Entry.published_objects.get(slug_pl='o-nas') +)) ITEMS.append(ModelMenuItem(Entry, reverse_lazy('migdal_entry_list_publications'), field_lookups={'type': 'publications'}, title=_('Publications'))) -ITEMS.append(MenuItem(reverse_lazy('events'), _('Events'), - more_urls=(reverse_lazy('events_past'),))) +ITEMS.append(MenuItem(reverse_lazy('events'), _('Events'))) + +ITEMS.append(ObjectMenuItem( + obj_get=lambda:Category.objects.get(slug_pl='stanowisko'), + rev_lookups={Entry: 'categories'}, + title=_('Positions') +)) + +ITEMS.append(MenuItem(reverse_lazy('questions'), _('First aid'))) -ITEMS.append(ObjectMenuItem(Category.objects.get(slug_pl='stanowisko'), - rev_lookups={Entry: 'categories'}, title=_('Positions'))) -#CategoryMenuItem(Category.objects.get(slug_pl='stanowisko'), -# title=_('Positions')), +ITEMS.append(ObjectMenuItem( + obj_get=lambda:Entry.published_objects.get(slug_pl='pierwsza-pomoc'), + title=_('Guide') +))