3 ms·
This looks pretty good. I like that it leverages Django's CBVs. I couldn't tell from the docs if you could do queryset filtering though the URL's querystring (e
by megaman821 14y ago
This looks pretty good. I like that it leverages Django's CBVs. I couldn't tell from the docs if you could do queryset filtering though the URL's querystring (e.g http://api.example.com/blogs?author=10 http://api.example.com/blogs?author=10).
- tomchristie 14y agoIf 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....