summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/posts/views/guide_views.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/posts/views/guide_views.py b/app/posts/views/guide_views.py
index a4ff873..641da66 100644
--- a/app/posts/views/guide_views.py
+++ b/app/posts/views/guide_views.py
@@ -56,7 +56,11 @@ class GuideDetailView(LuxDetailView):
def get_context_data(self, **kwargs):
context = super(GuideDetailView, self).get_context_data(**kwargs)
- print(self.kwargs['topic'])
+ related = []
+ for obj in self.object.related.all():
+ model = apps.get_model(obj.model_name.app_label, obj.model_name.model)
+ related.append(model.objects.get(slug=obj.slug, pub_date=obj.pub_date))
+ context['related'] = related
topic = Category.objects.get(slug=self.kwargs['topic'])
context['topic'] = topic
context['breadcrumbs'] = ('Guides', topic.name )