Fix ManyToMany field default filter type#1287
Open
weilu wants to merge 5 commits intographql-python:mainfrom
Open
Fix ManyToMany field default filter type#1287weilu wants to merge 5 commits intographql-python:mainfrom
weilu wants to merge 5 commits intographql-python:mainfrom
Conversation
Collaborator
|
@weilu - Great work. As you called out already, it would be helpful to see a breaking test here as an example. You can see the existing tests in |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
It's a bug introduced in this commit: 2d4ca0a (part of PR #1119) It manifests as not accepting a list of IDs
[ID]but rather a single IDIDas filtering arguments for a m2m field. The bug can be replicated by adding a many-to-many relationship in the cookbook example app. Happy to clean up what I have locally and push it to a branch for quick reference if necessary.I do want to add test cases to this PR but I thought it's best/fastest to have @zbyte64 or @tcleonard point me to where's the best place to add it as they are more familiar with the existing fixtures & setup. Happy to add on.
Also, side question to @tcleonard on his modification of the function
get_filtering_args_from_filtersetin the above-mentioned commit, why adding all the type checking branching code in this method itself rather than expanding/modifyingmodel_field.formfieldas based on my quick read that seems to be where the logic of translating model_field to form_field is intended to live?