Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class DetailFlatView(DetailView):
- model = Flat
- template_name = 'templates/flat/detail_view.html'
- context_object_name = 'flat'
- def get_context_data(self, **kwargs):
- context = super().get_context_data(**kwargs)
- context['reviews'] = Review.objects.filter(flat_id=self.kwargs['pk'])
- context['photos'] = Image.objects.filter(flat_id=self.kwargs['pk'])
- return context
Advertisement
Add Comment
Please, Sign In to add comment