diff options
Diffstat (limited to 'app/guides/views.py')
-rw-r--r-- | app/guides/views.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/app/guides/views.py b/app/guides/views.py index 8b5aeaa..01dc974 100644 --- a/app/guides/views.py +++ b/app/guides/views.py @@ -14,12 +14,19 @@ class GuideListView(PaginatedListView): qs = Guide.objects.filter(status=1) return qs -class GuideCatListView(PaginatedListView): + def get_context_data(self, **kwargs): + # Call the base implementation first to get a context + context = super(GuideListView, self).get_context_data(**kwargs) + context['topic_list'] = Guide.tags.all() + return context + + +class GuideCatListView(GuideListView): model = Guide def get_queryset(self, **kwargs): cat = Category.objects.get(slug=self.kwargs['slug']) - qs = Guide.objects.filter(status=1, category=cat) + qs = Guide.objects.filter(status=1, tags=cat) return qs class GuideDetailView(DetailView): |