From 203b73515f6b7391d83278af6ff399fd5bc6d6a0 Mon Sep 17 00:00:00 2001 From: SaJH Date: Tue, 21 May 2024 02:07:00 +0900 Subject: [PATCH] Added types using QuerySet[Any] and Callable[..., Any] --- .../db/models/fields/related_descriptors.pyi | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/django-stubs/db/models/fields/related_descriptors.pyi b/django-stubs/db/models/fields/related_descriptors.pyi index e8f22b27a..a6efc796a 100644 --- a/django-stubs/db/models/fields/related_descriptors.pyi +++ b/django-stubs/db/models/fields/related_descriptors.pyi @@ -27,19 +27,19 @@ class ForwardManyToOneDescriptor(Generic[_F]): @cached_property def RelatedObjectDoesNotExist(self) -> type[ObjectDoesNotExist]: ... def is_cached(self, instance: Model) -> bool: ... - def get_queryset(self, **hints: Any) -> QuerySet: ... + def get_queryset(self, **hints: Any) -> QuerySet[Any]: ... def get_prefetch_queryset( - self, instances: list[Model], queryset: QuerySet | None = ... - ) -> tuple[QuerySet, Callable, Callable, bool, str, bool]: ... + self, instances: list[Model], queryset: QuerySet[Any] | None = ... + ) -> tuple[QuerySet[Any], Callable[..., Any], Callable[..., Any], bool, str, bool]: ... def get_prefetch_querysets( - self, instances: list[Model], querysets: list[QuerySet] | None = ... - ) -> tuple[QuerySet, Callable, Callable, bool, str, bool]: ... + self, instances: list[Model], querysets: list[QuerySet[Any]] | None = ... + ) -> tuple[QuerySet[Any], Callable[..., Any], Callable[..., Any], bool, str, bool]: ... def get_object(self, instance: Model) -> Model: ... def __get__( self, instance: Model | None, cls: type[Model] | None = ... ) -> Model | ForwardManyToOneDescriptor | None: ... def __set__(self, instance: Model, value: Model | None) -> None: ... - def __reduce__(self) -> tuple[Callable, tuple[type[Model], str]]: ... + def __reduce__(self) -> tuple[Callable[..., Any], tuple[type[Model], str]]: ... class ForwardOneToOneDescriptor(ForwardManyToOneDescriptor[_F]): def get_object(self, instance: Model) -> Model: ...