From 939f91c4aba830bfa3341103dbf4b98bc86500b7 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Thu, 28 Sep 2023 10:53:06 -0400 Subject: [PATCH] fill out descriptor for ModelStateFieldsCacheDescriptor (#1743) --- django-stubs/db/models/base.pyi | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/django-stubs/db/models/base.pyi b/django-stubs/db/models/base.pyi index eb3bb35f0..623f8c8ac 100644 --- a/django-stubs/db/models/base.pyi +++ b/django-stubs/db/models/base.pyi @@ -1,5 +1,5 @@ from collections.abc import Collection, Iterable, Sequence -from typing import Any, ClassVar, Final, TypeVar +from typing import Any, ClassVar, Final, TypeVar, overload from django.core.checks.messages import CheckMessage from django.core.exceptions import MultipleObjectsReturned as BaseMultipleObjectsReturned @@ -11,7 +11,11 @@ from typing_extensions import Self _Self = TypeVar("_Self", bound=Model) -class ModelStateFieldsCacheDescriptor: ... +class ModelStateFieldsCacheDescriptor: + @overload + def __get__(self, inst: None, owner: object) -> Self: ... + @overload + def __get__(self, inst: object, owner: object) -> dict[Any, Any]: ... class ModelState: db: str | None