Files
@ 956f8c6fdaad
Branch filter:
Location: website/conservancy/sponsors.py - annotation
956f8c6fdaad
740 B
text/x-python
podjango: Add "Podcast" model to support multiple podcasts
Each Cast (episode) can belong to one or more Podcast, allowing episodes to be
shared between podcasts. This enables us introductory episodes to be delivered
in their own feed, but also included in the main "The Corresponding Source"
feed.
This required adding an additional `podcast_slug` argument to most views. The
date archive views were dropped because they're not linked to from anywhere.
Added a `podcasts` view as an index of all available Podcasts.
Each Cast (episode) can belong to one or more Podcast, allowing episodes to be
shared between podcasts. This enables us introductory episodes to be delivered
in their own feed, but also included in the main "The Corresponding Source"
feed.
This required adding an additional `podcast_slug` argument to most views. The
date archive views were dropped because they're not linked to from anywhere.
Added a `podcasts` view as an index of all available Podcasts.
462cbc396354 462cbc396354 b7e2ce2a4d44 b7e2ce2a4d44 531a97a3c9af b7e2ce2a4d44 b7e2ce2a4d44 462cbc396354 462cbc396354 462cbc396354 462cbc396354 462cbc396354 462cbc396354 462cbc396354 e45322d3c93e f723a74f5110 dbeada5b0b63 462cbc396354 462cbc396354 f723a74f5110 e45322d3c93e f723a74f5110 462cbc396354 66dbfac066b0 | from datetime import datetime, timedelta
from django.shortcuts import render
from .supporters.models import Supporter
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())
supporters_count = len(supporters)
anonymous_count = len(supporters.filter(display_name = 'Anonymous'))
supporters = supporters.exclude(display_name = 'Anonymous').order_by('ledger_entity_id')
c = {
'supporters' : supporters,
'supporters_count' : supporters_count,
'anonymous_count' : anonymous_count
}
return render(request, "sponsors.html", c)
|