def index(request):

    # get all districts with active school surveys
    active_schools = School.objects.filter(
        Q(surveyset__begin__lte=datetime.now()) &
        Q(surveyset__end__gte=datetime.now())
    )
    districts = District.objects.filter(school__in=active_schools).distinct()

    return render_to_response('survey/index.html', locals(), context_instance=RequestContext(request))