diff options
Diffstat (limited to 'app/posts/views/range_views.py')
-rw-r--r-- | app/posts/views/range_views.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/app/posts/views/range_views.py b/app/posts/views/range_views.py index 0a3a564..0a808b8 100644 --- a/app/posts/views/range_views.py +++ b/app/posts/views/range_views.py @@ -22,6 +22,14 @@ class RangeDetailView(LuxDetailView): slug_field = "slug" template_name = "posts/range_detail.html" + def get_context_data(self, **kwargs): + context = super(RangeDetailView, self).get_context_data(**kwargs) + 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 + return context class RangeListView(PaginatedListView): """ |