This commit is contained in:
Toran Billups 2013-02-10 14:10:35 -08:00
commit c3b31cc314

View File

@ -102,7 +102,7 @@ If all you need is simple equality-based filtering, you can set a `filter_fields
class ProductList(generics.ListAPIView):
model = Product
serializer_class = ProductSerializer
filter_fields = ('category', 'in_stock')
filter_fields = ['category', 'in_stock']
This will automatically create a `FilterSet` class for the given fields, and will allow you to make requests such as:
@ -175,4 +175,4 @@ For example:
[cite]: https://docs.djangoproject.com/en/dev/topics/db/queries/#retrieving-specific-objects-with-filters
[django-filter]: https://github.com/alex/django-filter
[django-filter-docs]: https://django-filter.readthedocs.org/en/latest/index.html
[nullbooleanselect]: https://github.com/django/django/blob/master/django/forms/widgets.py
[nullbooleanselect]: https://github.com/django/django/blob/master/django/forms/widgets.py