From 618a60aab65c5146bc2a64c12dd7b88ce72c45b4 Mon Sep 17 00:00:00 2001 From: luxagraf Date: Sat, 17 Dec 2022 14:44:26 -0600 Subject: pod: added url structure for lulu&birdie podcast --- app/podcasts/models.py | 1 - app/podcasts/urls.py | 5 +++++ app/podcasts/views.py | 15 ++++++++++++++- 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/app/podcasts/models.py b/app/podcasts/models.py index b574986..9e458b3 100644 --- a/app/podcasts/models.py +++ b/app/podcasts/models.py @@ -11,7 +11,6 @@ try: except: License = None -from taggit.managers import TaggableManager from mutagen.mp3 import MP3 from media.models import LuxAudio, LuxImage diff --git a/app/podcasts/urls.py b/app/podcasts/urls.py index 622b203..f4e39ea 100644 --- a/app/podcasts/urls.py +++ b/app/podcasts/urls.py @@ -16,4 +16,9 @@ urlpatterns = [ {'page':1}, name="list" ), + path( + r'/episode/', + views.PodcastDetailView.as_view(), + name="detail" + ), ] diff --git a/app/podcasts/views.py b/app/podcasts/views.py index a8edbfa..38d761e 100644 --- a/app/podcasts/views.py +++ b/app/podcasts/views.py @@ -8,7 +8,7 @@ from django.shortcuts import get_object_or_404 from django.conf import settings from django.db.models import Q -from utils.views import PaginatedListView +from utils.views import PaginatedListView, LuxDetailView from .models import Episode, Podcast @@ -27,3 +27,16 @@ class PodcastListView(PaginatedListView): context['podcast'] = Podcast.objects.get(title="The Lulu & Birdie Podcast") return context +class PodcastDetailView(LuxDetailView): + """ + Return a single episodes + """ + model = Podcast + template_name = "podcasts/detail.html" + + 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") + return context + -- cgit v1.2.3-70-g09d2