From a04e0da2b8907d2aed6e98919a68f7ae2cb35eec Mon Sep 17 00:00:00 2001 From: luxagraf Date: Thu, 7 Mar 2019 11:41:22 -0600 Subject: added src to main site --- app/src/views.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'app/src/views.py') diff --git a/app/src/views.py b/app/src/views.py index 876f99e..f501637 100644 --- a/app/src/views.py +++ b/app/src/views.py @@ -45,15 +45,19 @@ class BookDetailView(DetailView): class SrcListView(ListView): - template_name = "archives/src_home.html" - def queryset(self): + def get_queryset(self): return Post.objects.filter(status__exact=1) + def get_context_data(self, **kwargs): + # Call the base implementation first to get a context + context = super(SrcListView, self).get_context_data(**kwargs) + context['topics'] = Topic.objects.all() + return context + class EntryDetailView(DetailView): model = Post - template_name = "details/src_entry.html" slug_field = "slug" @@ -62,9 +66,9 @@ class EntryDetailViewTXT(EntryDetailView): class TopicListView(ListView): - template_name = 'archives/src_home.html' + template_name = 'src/topic_list.html' - def queryset(self): + def get_queryset(self): return Post.objects.filter(topics__slug=self.kwargs['slug']) def get_context_data(self, **kwargs): -- cgit v1.2.3-70-g09d2