4 ms·
If using the generic CBVs you can override .get_queryset() to implement filtering just as you would with regular Django CBVs. There's also an outstanding pull
by tomchristie 14y ago
If using the generic CBVs you can override .get_queryset() to implement filtering just as you would with regular Django CBVs.
There's also an outstanding pull req to build in support for django-filter and other filtering backends which now just needs some docs, and which I plan to have merged in within the next few days or so. https://github.com/tomchristie/django-rest-framework/pull/290 https://github.com/tomchristie/django-rest-framework/pull/29... That'll make it easier to do more complex filtering stuff. (And eventually have the filters be presented in the Browsable API)
- megaman821 14y agoI have a mixin that often use to do basic querystring filtering with CBVs, but it is nowhere near as comprehensive as http://django-tastypie.readthedocs.org/en/latest/resources.html#basic-filtering http://django-tastypie.readthedocs.org/en/latest/resources.h....