Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

filter on array fields should accept __in queries #237

Closed
stefanprobst opened this issue Sep 11, 2020 · 4 comments
Closed

filter on array fields should accept __in queries #237

stefanprobst opened this issue Sep 11, 2020 · 4 comments
Labels

Comments

@stefanprobst
Copy link

filter on array fields should accept __in operator as a query param, e.g. ?id__in=1,2,3 or ?topic__in=1,2,3,4

@stefanprobst
Copy link
Author

what does work though is https://sola.acdh-dev.oeaw.ac.at/apis/api/entities/passage/?topic=84&topic=126

@sennierer
Copy link
Collaborator

There is an issue with django-filters that is preventing the __in filter for m2m fields for the easiest method of registering filters in an DRF GenericView Class. I will rework the function for creating and registering the filters so we can use the __in filter throughout the API, but for the moment only the workaround mentioned above is working.

@sennierer sennierer added this to the [coladay] v0.2 milestone Oct 5, 2020
@sennierer sennierer added the API label Oct 5, 2020
@stefanprobst
Copy link
Author

personally, i'm totally fine with the long form ?topic=84&topic=126 syntax - we should just agree on what we want to support and stick to it

@sennierer
Copy link
Collaborator

we will keep the support for ?topic=84&topic=126. However, for consistency we will additionally add the __in operator also for m2m fields (currently only working for fk) at a later stage.
closing for now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants