Add podcast pages
This commit is contained in:
18
vrobbler/apps/podcasts/views.py
Normal file
18
vrobbler/apps/podcasts/views.py
Normal file
@ -0,0 +1,18 @@
|
||||
from django.views import generic
|
||||
from podcasts.models import Podcast
|
||||
|
||||
|
||||
class PodcastListView(generic.ListView):
|
||||
model = Podcast
|
||||
paginate_by = 20
|
||||
|
||||
|
||||
class PodcastDetailView(generic.DetailView):
|
||||
model = Podcast
|
||||
slug_field = "uuid"
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
user = self.request.user
|
||||
context_data = super().get_context_data(**kwargs)
|
||||
context_data["scrobbles"] = self.object.scrobbles(user)
|
||||
return context_data
|
||||
Reference in New Issue
Block a user