From 64685c86d380df900e7ccfe3b1bd924ebce70426 Mon Sep 17 00:00:00 2001 From: Brian Kohan Date: Wed, 11 Feb 2026 22:55:40 -0800 Subject: [PATCH] [django-filter] fix return type for MultipleChoiceFilter.get_filter_predicate (#15418) --- stubs/django-filter/django_filters/filters.pyi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stubs/django-filter/django_filters/filters.pyi b/stubs/django-filter/django_filters/filters.pyi index ad6af3fcb..40707625c 100644 --- a/stubs/django-filter/django_filters/filters.pyi +++ b/stubs/django-filter/django_filters/filters.pyi @@ -2,7 +2,7 @@ from collections.abc import Callable, Iterable from typing import Any from django import forms -from django.db.models import Q, QuerySet +from django.db.models import QuerySet from django.forms import Field from django_stubs_ext import StrOrPromise @@ -131,7 +131,7 @@ class MultipleChoiceFilter(Filter): ) -> None: ... def is_noop(self, qs: QuerySet[Any], value: Any) -> bool: ... # Value can be any filter input def filter(self, qs: QuerySet[Any], value: Any) -> QuerySet[Any]: ... - def get_filter_predicate(self, v: Any) -> Q: ... # Predicate value can be any filter input type + def get_filter_predicate(self, v: Any) -> dict[str, Any]: ... # Predicate value can be any filter input type class TypedMultipleChoiceFilter(MultipleChoiceFilter): field_class: type[forms.TypedMultipleChoiceField] # More specific than parent MultipleChoiceField