def METHOD_NAME(request):
    elections = Election.objects.filter(isactive=True).order_by('startdate')
    open_elections = [e for e in elections if e.startdate <= today_global() and e.enddate >= today_global()]
    past_elections = [e for e in elections if e.startdate < today_global() and e.enddate < today_global()]
    upcoming_elections = [e for e in elections if e.startdate > today_global()]
    return render(request, 'elections/home.html', {
        'open': open_elections,
        'past': past_elections,
        'upcoming': upcoming_elections,
    })