2015-01-03 14:36:22 +00:00
|
|
|
from django.shortcuts import render_to_response
|
|
|
|
from conservancy.apps.supporters.models import Supporter as Supporter
|
|
|
|
from datetime import datetime, timedelta
|
|
|
|
|
|
|
|
def view(request):
|
|
|
|
"""Conservancy Sponsors Page view
|
|
|
|
|
|
|
|
Performs object queries necessary to render the sponsors page.
|
|
|
|
"""
|
|
|
|
|
|
|
|
supporters = Supporter.objects.all().filter(display_until_date__gte=datetime.now())
|
2015-01-03 15:02:02 +00:00
|
|
|
supporters_count = len(supporters)
|
2015-01-03 14:53:44 +00:00
|
|
|
anonymous_count = len(supporters.filter(display_name = 'Anonymous'))
|
2015-01-04 17:26:25 +00:00
|
|
|
supporters = supporters.exclude(display_name = 'Anonymous').order_by('ledger_entity_id')
|
2015-01-03 14:36:22 +00:00
|
|
|
|
|
|
|
c = {
|
2015-01-03 14:53:44 +00:00
|
|
|
'supporters' : supporters,
|
2015-01-03 15:02:02 +00:00
|
|
|
'supporters_count' : supporters_count,
|
2015-01-03 14:53:44 +00:00
|
|
|
'anonymous_count' : anonymous_count
|
2015-01-03 14:36:22 +00:00
|
|
|
}
|
|
|
|
return render_to_response("sponsors.html", c)
|