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

Fix ManyToMany field default filter type #1287

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions graphene_django/filter/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,11 @@ def get_filtering_args_from_filterset(filterset_class, type):
form_field = form_field or filter_field.field
field_type = convert_form_field(form_field).get_type()

if isinstance(filter_field, ListFilter) or isinstance(
filter_field, RangeFilter
if (
isinstance(filter_field, ListFilter)
or isinstance(filter_field, RangeFilter)
or isinstance(form_field, forms.ModelMultipleChoiceField)
or isinstance(form_field, GlobalIDMultipleChoiceField)
):
# Replace InFilter/RangeFilter filters (`in`, `range`) argument type to be a list of
# the same type as the field. See comments in `replace_csv_filters` method for more details.
Expand Down