diff options
author | luxagraf <sng@luxagraf.net> | 2022-12-17 14:44:26 -0600 |
---|---|---|
committer | luxagraf <sng@luxagraf.net> | 2022-12-17 14:44:26 -0600 |
commit | 618a60aab65c5146bc2a64c12dd7b88ce72c45b4 (patch) | |
tree | 33d925183248d2aba558c8ab143a48bfbd2e259b /app | |
parent | 4ecc8fca59c3a5e36530e88859cb9f9347444efc (diff) |
pod: added url structure for lulu&birdie podcast
Diffstat (limited to 'app')
-rw-r--r-- | app/podcasts/models.py | 1 | ||||
-rw-r--r-- | app/podcasts/urls.py | 5 | ||||
-rw-r--r-- | 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'<str:slug>/episode/<int:page>', + 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 + |