summaryrefslogtreecommitdiff
path: root/app/guides/views.py
diff options
context:
space:
mode:
authorlxf <sng@luxagraf.net>2019-09-14 15:06:05 +0000
committerlxf <sng@luxagraf.net>2019-09-14 15:06:05 +0000
commit9e7aadbcf9bab0ecfcd4afc96f6a09f9fe11a197 (patch)
treeba056544401660a4206b26f177d0356e324e8f65 /app/guides/views.py
parentaf7472b6e198c25baded825cd33df7d2782f461a (diff)
parente4dca5792a9ef843ae5a1f35a8166551747f33f2 (diff)
Merge branch 'master' of ssh://luxgit/luxagraf/luxagraf.net
Diffstat (limited to 'app/guides/views.py')
-rw-r--r--app/guides/views.py11
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):