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

Fixes #16024: Change attr_type from list to str for MultipleChoiceFilter #17638

Merged
merged 1 commit into from
Oct 3, 2024

Conversation

jeremystretch
Copy link
Member

@jeremystretch jeremystretch commented Sep 27, 2024

Fixes: #16024

This seems to fix the AND/OR/NOT filtering specifically for multiple-choice filters. Additional work is likely needed but I wanted to put this out there for testing.

@arthanson
Copy link
Collaborator

That does seem to fix the major issues, there are some issues with NOT handling, but I think that is potentially a separate issue.

Copy link
Collaborator

@arthanson arthanson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think go ahead with this. It is a work-around rather than a direct fix, but will fix it for this specific case as it bypasses using Django-filter and doesn't fix the underlying incompatibility between Strawberry and Django-filter. But this does fix a a larger part of the filtering and I couldn't find a drawback to going forward with this.

What this basically does is not go the Django-filter function to do the filtering, but just relies on Strawberry to do a char filter, which works as this is on the model and is char field.

@jeremystretch jeremystretch merged commit f11dc00 into develop Oct 3, 2024
6 checks passed
@jeremystretch jeremystretch deleted the 16024-graphql-filtering branch October 3, 2024 17:24
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

New GraphQL filters (AND, OR and NOT) don't work as intended
2 participants