context_processors.py 491 Bytes
Newer Older
1
from representatives.models import Chamber, Group
2 3 4 5


def search_form_options(request):
    d = {}
Nicolas Joyard's avatar
Nicolas Joyard committed
6 7
    # Note: Those queries needs to be eval in the template so that we can cache
    # it efficiently
8

9
    d['chambers'] = Chamber.objects.all()
10 11 12 13 14 15
    d['countries'] = Group.objects.filter(kind='country')
    d['parties'] = Group.objects.filter(kind='group')
    d['delegations'] = Group.objects.filter(kind='delegation')
    d['committees'] = Group.objects.filter(kind='committee')

    return d