diff --git a/django_stubs_ext/django_stubs_ext/__init__.py b/django_stubs_ext/django_stubs_ext/__init__.py index d82aea6cf..6fd35f3b2 100644 --- a/django_stubs_ext/django_stubs_ext/__init__.py +++ b/django_stubs_ext/django_stubs_ext/__init__.py @@ -1,7 +1,16 @@ +from .aliases import StrOrPromise, StrPromise from .aliases import ValuesQuerySet as ValuesQuerySet from .annotations import Annotations as Annotations from .annotations import WithAnnotations as WithAnnotations from .patch import monkeypatch as monkeypatch from .types import AnyAttrAllowed as AnyAttrAllowed -__all__ = ["monkeypatch", "ValuesQuerySet", "WithAnnotations", "Annotations", "AnyAttrAllowed"] +__all__ = [ + "monkeypatch", + "ValuesQuerySet", + "WithAnnotations", + "Annotations", + "AnyAttrAllowed", + "StrPromise", + "StrOrPromise", +] diff --git a/django_stubs_ext/django_stubs_ext/aliases.py b/django_stubs_ext/django_stubs_ext/aliases.py index 7ff4dbe5c..90ab07db9 100644 --- a/django_stubs_ext/django_stubs_ext/aliases.py +++ b/django_stubs_ext/django_stubs_ext/aliases.py @@ -2,9 +2,15 @@ if typing.TYPE_CHECKING: from django.db.models.query import _T, _QuerySet, _Row + from django.utils.functional import _StrOrPromise as StrOrPromise + from django.utils.functional import _StrPromise as StrPromise ValuesQuerySet = _QuerySet[_T, _Row] else: from django.db.models.query import QuerySet + from django.utils.functional import Promise as StrPromise ValuesQuerySet = QuerySet + StrOrPromise = typing.Union[str, StrPromise] + +__all__ = ["StrOrPromise", "StrPromise", "ValuesQuerySet"]