Permalink
Browse files

imporving the ajaxyfication

added agendas.utils.get_agenda_ids_for_model
add id for links
improving member and party views
  • Loading branch information...
1 parent a559c1f commit a91d9b6436dd275b976fd3cb023929c0b9467337 @OriHoch OriHoch committed Mar 30, 2012
Showing with 93 additions and 422 deletions.
  1. +8 −0 src/knesset/agendas/utils.py
  2. +1 −0 src/knesset/links/views.py
  3. +84 −422 src/knesset/mks/views.py
@@ -2,6 +2,14 @@
from models import Agenda
from django.core.urlresolvers import reverse
+def get_agenda_ids_for_model(obj,user=None):
+ agendas=get_agendas_context_for_model(obj,user)
+ agenda_ids=[]
+ for agenda in agendas:
+ if user is None or agenda['watched']:
+ agenda_ids.append(agenda['id'])
+ return agenda_ids
+
def get_agendas_context_for_model(obj,user=None):
# do this import here to prevent some kind of circular import
from knesset.agendas.views import AgendaDetailView
@@ -10,6 +10,7 @@ def get_object_links_context(obj):
linktype=dict(
image=unicode(link.link_type.image),
title=link.link_type.title,
+ id=link.link_type.id,
)
links.append(dict(
active=link.active,
Oops, something went wrong.

0 comments on commit a91d9b6

Please sign in to comment.