diff --git a/django-stubs/db/models/manager.pyi b/django-stubs/db/models/manager.pyi index 78fdcaa58..3ed250aaa 100644 --- a/django-stubs/db/models/manager.pyi +++ b/django-stubs/db/models/manager.pyi @@ -1,5 +1,5 @@ from collections.abc import Iterable, MutableMapping -from typing import Any, Generic, TypeVar +from typing import Any, Callable, Generic, TypeVar from typing_extensions import Self from django.db.models.base import Model @@ -19,21 +19,24 @@ class BaseManager(QuerySet[_T]): def __init__(self) -> None: ... def deconstruct( self, - ) -> tuple[bool, str, None, tuple[Any, ...], dict[str, int]]: ... + ) -> tuple[bool, str | None, str | None, tuple[Any, ...] | None, dict[str, Any] | None]: ... def check(self, **kwargs: Any) -> list[Any]: ... @classmethod def from_queryset( - cls, queryset_class: type[QuerySet[Any]], class_name: str | None = ... - ) -> Any: ... + cls, queryset_class: type[QuerySet[_T]], class_name: str | None = ... + ) -> type[Manager[_T]]: ... @classmethod - def _get_queryset_methods(cls, queryset_class: type) -> dict[str, Any]: ... + def _get_queryset_methods( + cls, queryset_class: type[QuerySet[_T]] + ) -> dict[str, Callable[..., Any]]: ... def contribute_to_class(self, model: type[Model], name: str) -> None: ... def db_manager( self, using: str | None = ..., hints: dict[str, Model] | None = ... ) -> Self: ... def get_queryset(self) -> QuerySet[_T]: ... -class Manager(BaseManager[_T]): ... +class Manager(BaseManager[_T]): + _queryset_class: type[QuerySet[_T]] class RelatedManager(Manager[_T]): related_val: tuple[int, ...]