fix
[prawokultury.git] / prawokultury / menu_items.py
index f68b005..2a85fd6 100644 (file)
@@ -7,16 +7,9 @@ from django.utils.translation import ugettext_lazy as _
 
 ITEMS = []
 
 
 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(ModelMenuItem(Entry, reverse_lazy('migdal_entry_list_publications'),
         field_lookups={'type': 'publications'}, title=_('Publications')))
@@ -24,11 +17,20 @@ ITEMS.append(ModelMenuItem(Entry, reverse_lazy('migdal_entry_list_publications')
 ITEMS.append(MenuItem(reverse_lazy('events'), _('Events'),
         more_urls=(reverse_lazy('events_past'),)))
 
 ITEMS.append(MenuItem(reverse_lazy('events'), _('Events'),
         more_urls=(reverse_lazy('events_past'),)))
 
-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(Entry.objects.get(slug_pl='pierwsza-pomoc'),
-    title=_('First aid in copyright')))
-
+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'),
+        more_urls=(
+            reverse_lazy('questions_form'),
+            #reverse_lazy('questions_question'),
+            reverse_lazy('questions_thanks'),
+        )))
+
+ITEMS.append(ObjectMenuItem(
+    obj_get=lambda:Entry.published_objects.get(slug_pl='pierwsza-pomoc'),
+    title=_('Guide')
+))