filter here is a property, lazily instantiating the filter instance — I need it there because I still need the filter in the template.
Again, no real problem but it would be nice to just specify a filter_class, or filter_fields maybe... — in reality I'd guess most cases would merit a get_filter implementation, to get the customised filter instance — and have it Just Work™
The is kind of relevant to tomchristie/django-rest-framework#2180, where we need to keep the filter backends around in order to pass them to the template.
I'd like to add better support for filtering, similar to DRF. I have in mind Django Filter but a more generic filter backend interface would do too.
I've found first needing to implement
get_context_data
to pass the filter to the template. No problem here really.But then in order to support pagination I have to implement
get_paginator
:filter
here is a property, lazily instantiating the filter instance — I need it there because I still need the filter in the template.Again, no real problem but it would be nice to just specify a
filter_class
, orfilter_fields
maybe... — in reality I'd guess most cases would merit aget_filter
implementation, to get the customised filter instance — and have it Just Work™The is kind of relevant to tomchristie/django-rest-framework#2180, where we need to keep the filter backends around in order to pass them to the template.
I'm happy to do all this if it's acceptable.