project/scipycon/context_processors.py
author Madhusudan.C.S <madhusudancs@gmail.com>
Tue, 13 Jul 2010 17:59:47 +0530
changeset 94 87e77aa18610
permissions -rw-r--r--
Moved the files to new Django app named scipycon and modified settings.

from datetime import datetime

from django.conf import settings

from project.kiwipycon.sponsor.models import Sponsor

def sponsors(request):
    sponsors = Sponsor.objects.all()
    gold_sponsors = sponsors.filter(type='gold')
    silver_sponsors = sponsors.filter(type='silver')
    schwag_sponsors = sponsors.filter(type='schwag')
    return {
            'sponsors': {'gold': gold_sponsors,
                         'silver': silver_sponsors,
                         'schwag': schwag_sponsors}
    }