File: aliases.py

package info (click to toggle)
python-django-stubs 5.2.9-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,832 kB
  • sloc: python: 5,185; makefile: 15; sh: 8
file content (20 lines) | stat: -rw-r--r-- 714 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import typing

if typing.TYPE_CHECKING:
    from django.db.models.query import _QuerySet
    from django.utils.functional import _StrOrPromise as StrOrPromise
    from django.utils.functional import _StrPromise as StrPromise

    # Deprecated type aliases. Use the QuerySet class directly instead.
    QuerySetAny = _QuerySet
    ValuesQuerySet = _QuerySet
else:
    from django.db.models.query import QuerySet
    from django.utils.functional import Promise as StrPromise

    StrOrPromise = str | StrPromise
    # Deprecated type aliases. Use the QuerySet class directly instead.
    QuerySetAny = QuerySet
    ValuesQuerySet = QuerySet

__all__ = ["QuerySetAny", "StrOrPromise", "StrPromise", "ValuesQuerySet"]