diff options
author | luxagraf <sng@luxagraf.net> | 2019-03-07 11:41:22 -0600 |
---|---|---|
committer | luxagraf <sng@luxagraf.net> | 2019-03-07 11:41:22 -0600 |
commit | a04e0da2b8907d2aed6e98919a68f7ae2cb35eec (patch) | |
tree | 871799d46c78c952be5f223d74dbe1ca8fd7e136 /app | |
parent | 0e6777be5dc1f34ac83dda3da884b1c8e42045ee (diff) |
added src to main site
Diffstat (limited to 'app')
-rw-r--r-- | app/src/views.py | 14 |
1 files changed, 9 insertions, 5 deletions
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): |