Closed kyleobrien91 closed 7 years ago
I meant to include some information on my package versions
from the code sample above it does not look like you are using django-url-filter:
from django_filters.rest_framework import DjangoFilterBackend
if you would like to use this package you can use:
from url_filter.integrations.drf import DjangoFilterBackend
and yes once you use that __in
should be one of available lookups.
closing issue for now however feel free to reopen or create issues if you will have further issues.
@miki725 - 100%. I was being an utter chop. It works perfectly.
@kyleobrien91 np. everyone does those... 😄
Based on the documentation, it seems I should just be able to configure my viewset as follows and automatically get filtering. However, certain URL filtering seems to be ignored completed.
Assuming that viewset maps to an endpoint like
/users/
, I should be able to use a query like/users?id__in=1,2,3,4,5
and only see results where the ID is either 1, 2, 3, 4 or 5.However, that's not the case. Using that minimal setup, I can only use a filter like
/users/?id=1
. As soon as I useid__in=1,2,3,4,5
, I get my entire queryset back - all 20 users.Am I missing a setup step?