diff options
author | luxagraf <sng@luxagraf.net> | 2022-12-17 16:24:04 -0600 |
---|---|---|
committer | luxagraf <sng@luxagraf.net> | 2022-12-17 16:24:04 -0600 |
commit | 250c9dabae53407b7e1f76cb619729f2672ed82d (patch) | |
tree | 78a800e6cee9cc33bc3711b84daa456d357e0947 /app/podcasts/views.py | |
parent | a60db651e4818a32509094b2a052fa7fac97389f (diff) |
pod: finished podcast framework
Diffstat (limited to 'app/podcasts/views.py')
-rw-r--r-- | app/podcasts/views.py | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/app/podcasts/views.py b/app/podcasts/views.py index 38d761e..9f955b5 100644 --- a/app/podcasts/views.py +++ b/app/podcasts/views.py @@ -24,9 +24,10 @@ class PodcastListView(PaginatedListView): def get_context_data(self, **kwargs): context = super(PodcastListView, self).get_context_data(**kwargs) context['breadcrumbs'] = ['podcast',] - context['podcast'] = Podcast.objects.get(title="The Lulu & Birdie Podcast") + context['podcast'] = Podcast.objects.get(slug=self.kwargs['slug']) return context + class PodcastDetailView(LuxDetailView): """ Return a single episodes @@ -37,6 +38,19 @@ class PodcastDetailView(LuxDetailView): def get_context_data(self, **kwargs): context = super(PodcastListView, self).get_context_data(**kwargs) context['breadcrumbs'] = ['podcast',] - context['podcast'] = Podcast.objects.get(title="The Lulu & Birdie Podcast") + context['podcast'] = Podcast.objects.get(slug=self.kwargs['slug']) return context + +class EpisodeListView(PaginatedListView): + """ + Return a list of Episodes in reverse chronological order + """ + model = Episode + template_name = "podcasts/list-episode.html" + + def get_context_data(self, **kwargs): + context = super(EpisodeListView, self).get_context_data(**kwargs) + context['breadcrumbs'] = ['podcast',] + context['podcast'] = Podcast.objects.get(slug=self.kwargs['slug']) + return context |