mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-05-04 12:35:49 +08:00
[django-filter] fix return type for MultipleChoiceFilter.get_filter_predicate (#15418)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user