2015-01-03 14:36:22 +00:00
|
|
|
from datetime import datetime, timedelta
|
|
|
|
|
2023-10-19 22:44:24 +00:00
|
|
|
from django.shortcuts import render
|
|
|
|
|
|
|
|
from .apps.supporters.models import Supporter
|
|
|
|
|
|
|
|
|
2015-01-03 14:36:22 +00:00
|
|
|
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
|
|
|
}
|
2017-11-03 15:58:24 +00:00
|
|
|
return render(request, "sponsors.html", c)
|