diff options
author | lxf <sng@luxagraf.net> | 2019-09-14 15:06:05 +0000 |
---|---|---|
committer | lxf <sng@luxagraf.net> | 2019-09-14 15:06:05 +0000 |
commit | 9e7aadbcf9bab0ecfcd4afc96f6a09f9fe11a197 (patch) | |
tree | ba056544401660a4206b26f177d0356e324e8f65 /app/guides/views.py | |
parent | af7472b6e198c25baded825cd33df7d2782f461a (diff) | |
parent | e4dca5792a9ef843ae5a1f35a8166551747f33f2 (diff) |
Merge branch 'master' of ssh://luxgit/luxagraf/luxagraf.net
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): |