django-types 0.19.1__py3-none-any.whl → 0.21.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. django-stubs/contrib/admin/__init__.pyi +1 -0
  2. django-stubs/contrib/admin/actions.pyi +2 -2
  3. django-stubs/contrib/admin/decorators.pyi +4 -3
  4. django-stubs/contrib/admin/filters.pyi +5 -5
  5. django-stubs/contrib/admin/models.pyi +23 -11
  6. django-stubs/contrib/admin/options.pyi +67 -38
  7. django-stubs/contrib/admin/sites.pyi +11 -11
  8. django-stubs/contrib/admin/templatetags/base.pyi +1 -1
  9. django-stubs/contrib/admin/utils.pyi +2 -2
  10. django-stubs/contrib/admin/views/autocomplete.pyi +2 -2
  11. django-stubs/contrib/admin/views/main.pyi +8 -7
  12. django-stubs/contrib/admindocs/middleware.pyi +2 -2
  13. django-stubs/contrib/auth/__init__.pyi +14 -4
  14. django-stubs/contrib/auth/admin.pyi +2 -2
  15. django-stubs/contrib/auth/backends.pyi +22 -0
  16. django-stubs/contrib/auth/base_user.pyi +3 -3
  17. django-stubs/contrib/auth/forms.pyi +1 -1
  18. django-stubs/contrib/auth/middleware.pyi +1 -2
  19. django-stubs/contrib/auth/models.pyi +50 -26
  20. django-stubs/contrib/auth/views.pyi +1 -2
  21. django-stubs/contrib/contenttypes/fields.pyi +1 -1
  22. django-stubs/contrib/contenttypes/models.pyi +3 -1
  23. django-stubs/contrib/flatpages/middleware.pyi +2 -2
  24. django-stubs/contrib/flatpages/views.pyi +3 -3
  25. django-stubs/contrib/postgres/fields/array.pyi +6 -5
  26. django-stubs/contrib/postgres/fields/citext.pyi +13 -8
  27. django-stubs/contrib/postgres/fields/hstore.pyi +5 -4
  28. django-stubs/contrib/staticfiles/finders.pyi +1 -2
  29. django-stubs/contrib/staticfiles/views.pyi +2 -2
  30. django-stubs/contrib/syndication/views.pyi +4 -4
  31. django-stubs/core/cache/backends/base.pyi +9 -0
  32. django-stubs/core/exceptions.pyi +18 -11
  33. django-stubs/core/files/base.pyi +1 -1
  34. django-stubs/core/files/storage.pyi +2 -2
  35. django-stubs/core/mail/__init__.pyi +1 -1
  36. django-stubs/core/mail/backends/base.pyi +1 -0
  37. django-stubs/core/mail/message.pyi +6 -6
  38. django-stubs/core/serializers/json.pyi +1 -1
  39. django-stubs/core/servers/basehttp.pyi +2 -2
  40. django-stubs/db/backends/utils.pyi +1 -2
  41. django-stubs/db/migrations/recorder.pyi +1 -1
  42. django-stubs/db/models/base.pyi +9 -3
  43. django-stubs/db/models/constraints.pyi +1 -0
  44. django-stubs/db/models/enums.pyi +10 -19
  45. django-stubs/db/models/expressions.pyi +1 -1
  46. django-stubs/db/models/fields/__init__.pyi +227 -77
  47. django-stubs/db/models/fields/files.pyi +2 -2
  48. django-stubs/db/models/fields/json.pyi +10 -6
  49. django-stubs/db/models/fields/related.pyi +42 -20
  50. django-stubs/db/models/fields/related_descriptors.pyi +3 -3
  51. django-stubs/db/models/functions/__init__.pyi +2 -0
  52. django-stubs/db/models/functions/comparison.pyi +8 -0
  53. django-stubs/db/models/manager.pyi +11 -6
  54. django-stubs/db/models/query.pyi +4 -1
  55. django-stubs/db/models/query_utils.pyi +1 -0
  56. django-stubs/db/transaction.pyi +7 -1
  57. django-stubs/forms/boundfield.pyi +3 -1
  58. django-stubs/forms/forms.pyi +28 -35
  59. django-stubs/forms/formsets.pyi +98 -63
  60. django-stubs/forms/models.pyi +22 -17
  61. django-stubs/forms/renderers.pyi +26 -13
  62. django-stubs/forms/utils.pyi +38 -11
  63. django-stubs/http/cookie.pyi +3 -1
  64. django-stubs/http/request.pyi +43 -16
  65. django-stubs/http/response.pyi +38 -30
  66. django-stubs/shortcuts.pyi +1 -2
  67. django-stubs/template/backends/base.pyi +14 -5
  68. django-stubs/template/backends/django.pyi +24 -3
  69. django-stubs/template/backends/dummy.pyi +7 -6
  70. django-stubs/template/backends/jinja2.pyi +20 -2
  71. django-stubs/template/backends/utils.pyi +3 -3
  72. django-stubs/template/base.pyi +2 -2
  73. django-stubs/template/context.pyi +2 -2
  74. django-stubs/template/context_processors.pyi +1 -2
  75. django-stubs/template/library.pyi +79 -15
  76. django-stubs/template/loader.pyi +5 -3
  77. django-stubs/template/response.pyi +3 -3
  78. django-stubs/template/utils.pyi +6 -4
  79. django-stubs/test/client.pyi +176 -20
  80. django-stubs/test/testcases.pyi +4 -4
  81. django-stubs/test/utils.pyi +41 -55
  82. django-stubs/urls/base.pyi +18 -2
  83. django-stubs/urls/conf.pyi +7 -0
  84. django-stubs/utils/cache.pyi +4 -4
  85. django-stubs/utils/datastructures.pyi +5 -5
  86. django-stubs/utils/deconstruct.pyi +10 -2
  87. django-stubs/utils/log.pyi +1 -1
  88. django-stubs/utils/six.pyi +1 -1
  89. django-stubs/utils/translation/__init__.pyi +5 -3
  90. django-stubs/utils/translation/trans_real.pyi +2 -2
  91. django-stubs/views/decorators/csrf.pyi +1 -1
  92. django-stubs/views/generic/edit.pyi +1 -2
  93. {django_types-0.19.1.dist-info → django_types-0.21.0.dist-info}/METADATA +12 -8
  94. {django_types-0.19.1.dist-info → django_types-0.21.0.dist-info}/RECORD +96 -96
  95. {django_types-0.19.1.dist-info → django_types-0.21.0.dist-info}/WHEEL +1 -1
  96. {django_types-0.19.1.dist-info → django_types-0.21.0.dist-info}/LICENSE.txt +0 -0
@@ -6,6 +6,7 @@ from typing_extensions import Self
6
6
  from django.core.mail.message import EmailMessage
7
7
 
8
8
  class BaseEmailBackend:
9
+ fail_silently: bool
9
10
  def __init__(self, fail_silently: bool = ..., **kwargs: Any) -> None: ...
10
11
  def open(self) -> bool | None: ...
11
12
  def close(self) -> None: ...
@@ -26,15 +26,15 @@ class MIMEMixin: ...
26
26
 
27
27
  class SafeMIMEMessage(MIMEMixin, MIMEMessage):
28
28
  defects: list[Any]
29
- epilogue: None
29
+ epilogue: None # pyright: ignore[reportIncompatibleVariableOverride]
30
30
  policy: Policy # type: ignore [no-any-unimported]
31
- preamble: None
31
+ preamble: None # pyright: ignore[reportIncompatibleVariableOverride]
32
32
 
33
33
  class SafeMIMEText(MIMEMixin, MIMEText):
34
34
  defects: list[Any]
35
- epilogue: None
35
+ epilogue: None # pyright: ignore[reportIncompatibleVariableOverride]
36
36
  policy: Policy # type: ignore [no-any-unimported]
37
- preamble: None
37
+ preamble: None # pyright: ignore[reportIncompatibleVariableOverride]
38
38
  encoding: str = ...
39
39
  def __init__(
40
40
  self, _text: str, _subtype: str = ..., _charset: str = ...
@@ -42,9 +42,9 @@ class SafeMIMEText(MIMEMixin, MIMEText):
42
42
 
43
43
  class SafeMIMEMultipart(MIMEMixin, MIMEMultipart):
44
44
  defects: list[Any]
45
- epilogue: None
45
+ epilogue: None # pyright: ignore[reportIncompatibleVariableOverride]
46
46
  policy: Policy # type: ignore [no-any-unimported]
47
- preamble: None
47
+ preamble: None # pyright: ignore[reportIncompatibleVariableOverride]
48
48
  encoding: str = ...
49
49
  def __init__(
50
50
  self,
@@ -12,6 +12,6 @@ class DjangoJSONEncoder(json.JSONEncoder):
12
12
  allow_nan: bool
13
13
  check_circular: bool
14
14
  ensure_ascii: bool
15
- indent: int
15
+ indent: int # pyright: ignore[reportIncompatibleVariableOverride]
16
16
  skipkeys: bool
17
17
  sort_keys: bool
@@ -28,8 +28,8 @@ class WSGIRequestHandler(simple_server.WSGIRequestHandler):
28
28
  close_connection: bool
29
29
  connection: WSGIRequest
30
30
  request: WSGIRequest
31
- rfile: BytesIO
32
- wfile: BytesIO
31
+ rfile: BytesIO # pyright: ignore[reportIncompatibleVariableOverride]
32
+ wfile: BytesIO # pyright: ignore[reportIncompatibleVariableOverride]
33
33
  protocol_version: str = ...
34
34
  def address_string(self) -> str: ...
35
35
  def log_message(self, format: str, *args: Any) -> None: ...
@@ -2,8 +2,7 @@ import types
2
2
  from collections.abc import Iterable, Iterator, Mapping, Sequence
3
3
  from datetime import date, datetime, time
4
4
  from decimal import Decimal
5
- from typing import IO, Any
6
- from typing_extensions import Literal
5
+ from typing import IO, Any, Literal
7
6
  from uuid import UUID
8
7
 
9
8
  import psycopg2.extensions
@@ -15,7 +15,7 @@ class MigrationRecorder:
15
15
  def migration_qs(self) -> QuerySet[Any]: ...
16
16
  def has_table(self) -> bool: ...
17
17
  def ensure_schema(self) -> None: ...
18
- def applied_migrations(self) -> set[tuple[str, str]]: ...
18
+ def applied_migrations(self) -> dict[tuple[str, str], Any]: ...
19
19
  def record_applied(self, app: str, name: str) -> None: ...
20
20
  def record_unapplied(self, app: str, name: str) -> None: ...
21
21
  def flush(self) -> None: ...
@@ -9,6 +9,7 @@ from django.core.exceptions import (
9
9
  from django.core.exceptions import ObjectDoesNotExist, ValidationError
10
10
  from django.db.models.manager import BaseManager
11
11
  from django.db.models.options import Options
12
+ from django.db.models.query import QuerySet
12
13
 
13
14
  class ModelStateFieldsCacheDescriptor: ...
14
15
 
@@ -26,7 +27,6 @@ class Model(metaclass=ModelBase):
26
27
  _default_manager: ClassVar[BaseManager[Self]]
27
28
  objects: ClassVar[BaseManager[Self]]
28
29
 
29
- class Meta: ...
30
30
  pk: Any = ...
31
31
  _state: ModelState
32
32
  def __init__(self, *args: Any, **kwargs: Any) -> None: ...
@@ -80,10 +80,16 @@ class Model(metaclass=ModelBase):
80
80
  update_fields: Iterable[str] | None = ...,
81
81
  ) -> Any: ...
82
82
  def refresh_from_db(
83
- self, using: str | None = ..., fields: list[str] | None = ...
83
+ self,
84
+ using: str | None = ...,
85
+ fields: list[str] | None = ...,
86
+ from_queryset: QuerySet[Self] | None = ...,
84
87
  ) -> None: ...
85
88
  async def arefresh_from_db(
86
- self, using: str | None = ..., fields: list[str] | None = ...
89
+ self,
90
+ using: str | None = ...,
91
+ fields: list[str] | None = ...,
92
+ from_queryset: QuerySet[Self] | None = ...,
87
93
  ) -> None: ...
88
94
  def get_deferred_fields(self) -> set[str]: ...
89
95
  @classmethod
@@ -61,4 +61,5 @@ class UniqueConstraint(BaseConstraint):
61
61
  include: str | Sequence[str] | None = ...,
62
62
  opclasses: Sequence[str] = ...,
63
63
  violation_error_message: str | None = ...,
64
+ nulls_distinct: bool | None = ...,
64
65
  ) -> None: ...
@@ -1,12 +1,17 @@
1
1
  import enum
2
- from typing import Any
2
+ from collections.abc import Sequence
3
+ from typing import Any, TypeVar
4
+
5
+ _EnumMemberT = TypeVar("_EnumMemberT")
3
6
 
4
7
  class ChoicesMeta(enum.EnumMeta):
5
8
  names: list[str] = ...
6
- choices: list[tuple[Any, str]] = ...
7
9
  labels: list[str] = ...
8
- values: list[Any] = ...
9
10
  def __contains__(self, item: Any) -> bool: ...
11
+ @property
12
+ def values(self: type[_EnumMemberT]) -> Sequence[_EnumMemberT]: ...
13
+ @property
14
+ def choices(self: type[_EnumMemberT]) -> Sequence[tuple[_EnumMemberT, str]]: ...
10
15
 
11
16
  class Choices(enum.Enum, metaclass=ChoicesMeta):
12
17
  def __str__(self) -> Any: ...
@@ -15,24 +20,10 @@ class Choices(enum.Enum, metaclass=ChoicesMeta):
15
20
  @property
16
21
  def value(self) -> Any: ...
17
22
 
18
- # fake
19
- class _IntegerChoicesMeta(ChoicesMeta):
20
- names: list[str] = ...
21
- choices: list[tuple[int, str]] = ...
22
- labels: list[str] = ...
23
- values: list[int] = ...
24
-
25
- class IntegerChoices(int, Choices, metaclass=_IntegerChoicesMeta):
23
+ class IntegerChoices(int, Choices):
26
24
  @property
27
25
  def value(self) -> int: ...
28
26
 
29
- # fake
30
- class _TextChoicesMeta(ChoicesMeta):
31
- names: list[str] = ...
32
- choices: list[tuple[str, str]] = ...
33
- labels: list[str] = ...
34
- values: list[str] = ...
35
-
36
- class TextChoices(str, Choices, metaclass=_TextChoicesMeta):
27
+ class TextChoices(str, Choices):
37
28
  @property
38
29
  def value(self) -> str: ...
@@ -49,7 +49,7 @@ class Combinable:
49
49
  def __radd__(
50
50
  self, other: datetime | _Numeric | Combinable | None
51
51
  ) -> Combinable: ...
52
- def __rsub__(self, other: _Numeric | Combinable) -> Combinable: ...
52
+ def __rsub__(self, other: datetime | _Numeric | Combinable) -> Combinable: ...
53
53
  def __rmul__(self, other: _Numeric | Combinable) -> Combinable: ...
54
54
  def __rtruediv__(self, other: _Numeric | Combinable) -> Combinable: ...
55
55
  def __rmod__(self, other: int | Combinable) -> Combinable: ...