If we have Foo
->Bar
, and a FooView(DetailView)
, we can filter the relationship using get_context_data
, eg:
class FooDetail(DetailView):
model = Foo
def get_context_data(self, **kwargs):
context = super(FooDetail, self).get_context_data(**kwargs)
context['bars'] = BarFilter(self.request.GET, ...)
return context