mirror of
https://github.com/davidhalter/django-stubs.git
synced 2026-08-30 19:37:00 +08:00
fourth iteration
This commit is contained in:
@@ -1,108 +1,11 @@
|
|||||||
from typing import Any, Callable, Dict, List, Optional, Tuple, Type, Union
|
from typing import Any, List, Optional, Union
|
||||||
|
|
||||||
from django.utils.functional import LazyObject
|
from django.utils.functional import LazyObject
|
||||||
|
|
||||||
ENVIRONMENT_VARIABLE: str
|
ENVIRONMENT_VARIABLE: str
|
||||||
|
|
||||||
class LazySettings(LazyObject):
|
class LazySettings(LazyObject):
|
||||||
def __getattr__(
|
def __getattr__(self, name: str) -> Any: ...
|
||||||
self, name: str
|
|
||||||
) -> Optional[
|
|
||||||
Union[
|
|
||||||
Callable,
|
|
||||||
Dict[int, None],
|
|
||||||
Dict[int, str],
|
|
||||||
Dict[str, Callable],
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Optional[
|
|
||||||
Union[
|
|
||||||
Dict[str, Union[Callable, Dict[str, int], str]],
|
|
||||||
Dict[str, Union[Dict[str, int], int, str]],
|
|
||||||
]
|
|
||||||
],
|
|
||||||
],
|
|
||||||
Dict[str, Optional[str]],
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Optional[
|
|
||||||
Union[Dict[Any, Any], Dict[str, None], int, str]
|
|
||||||
],
|
|
||||||
],
|
|
||||||
str,
|
|
||||||
],
|
|
||||||
],
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
Dict[str, Union[List[str], bool, str]],
|
|
||||||
Dict[str, Union[List[str], str]],
|
|
||||||
],
|
|
||||||
],
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[Dict[str, Union[List[str], str]], Dict[str, str]],
|
|
||||||
],
|
|
||||||
int,
|
|
||||||
str,
|
|
||||||
],
|
|
||||||
],
|
|
||||||
List[Dict[str, Union[Dict[str, List[Any]], List[Any], bool, str]]],
|
|
||||||
List[Dict[str, Union[Dict[str, Tuple[str]], List[str], str]]],
|
|
||||||
List[
|
|
||||||
Union[
|
|
||||||
Dict[str, Union[Dict[Any, Any], bool, str]],
|
|
||||||
Dict[str, Union[Dict[str, bool], bool, str]],
|
|
||||||
]
|
|
||||||
],
|
|
||||||
List[
|
|
||||||
Union[
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[Dict[str, List[Tuple[str, Dict[str, str]]]], str],
|
|
||||||
],
|
|
||||||
Dict[str, Union[Dict[str, int], str]],
|
|
||||||
]
|
|
||||||
],
|
|
||||||
List[
|
|
||||||
Union[
|
|
||||||
Dict[
|
|
||||||
str, Union[Dict[str, List[str]], List[str], bool, str]
|
|
||||||
],
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[Dict[str, Tuple[str, str]], List[str], bool, str],
|
|
||||||
],
|
|
||||||
]
|
|
||||||
],
|
|
||||||
List[
|
|
||||||
Union[
|
|
||||||
Dict[str, Union[Dict[str, bool], str]],
|
|
||||||
Dict[str, Union[Dict[str, int], str]],
|
|
||||||
]
|
|
||||||
],
|
|
||||||
List[
|
|
||||||
Union[
|
|
||||||
Dict[str, Union[Dict[str, int], str]],
|
|
||||||
Dict[str, Union[Dict[str, str], str]],
|
|
||||||
]
|
|
||||||
],
|
|
||||||
List[Union[Tuple[str, str], str]],
|
|
||||||
List[int],
|
|
||||||
Tuple[Tuple[str, str], Tuple[str, str]],
|
|
||||||
Tuple[str, str],
|
|
||||||
Type[Any],
|
|
||||||
float,
|
|
||||||
int,
|
|
||||||
str,
|
|
||||||
]
|
|
||||||
]: ...
|
|
||||||
def __setattr__(self, name: str, value: Any) -> None: ...
|
def __setattr__(self, name: str, value: Any) -> None: ...
|
||||||
def __delattr__(self, name: str) -> None: ...
|
def __delattr__(self, name: str) -> None: ...
|
||||||
def configure(self, default_settings: Any = ..., **options: Any) -> Any: ...
|
def configure(self, default_settings: Any = ..., **options: Any) -> Any: ...
|
||||||
@@ -124,136 +27,8 @@ class UserSettingsHolder:
|
|||||||
def __init__(
|
def __init__(
|
||||||
self, default_settings: Union[Settings, UserSettingsHolder]
|
self, default_settings: Union[Settings, UserSettingsHolder]
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
def __getattr__(
|
def __getattr__(self, name: str) -> Any: ...
|
||||||
self, name: str
|
def __setattr__(self, name: str, value: Any) -> None: ...
|
||||||
) -> Optional[
|
|
||||||
Union[
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Optional[Union[Dict[Any, Any], Dict[str, None], int, str]],
|
|
||||||
],
|
|
||||||
],
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Optional[
|
|
||||||
Union[
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
Dict[str, Union[List[str], bool, str]],
|
|
||||||
Dict[str, Union[List[str], str]],
|
|
||||||
],
|
|
||||||
],
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
Dict[str, Union[List[str], str]], Dict[str, str]
|
|
||||||
],
|
|
||||||
],
|
|
||||||
int,
|
|
||||||
]
|
|
||||||
],
|
|
||||||
],
|
|
||||||
Dict[str, str],
|
|
||||||
List[Dict[str, Union[Dict[str, List[str]], List[str], bool, str]]],
|
|
||||||
List[Dict[str, Union[Dict[str, Tuple[str]], List[str], bool, str]]],
|
|
||||||
List[Union[Tuple[str, str], str]],
|
|
||||||
List[int],
|
|
||||||
float,
|
|
||||||
int,
|
|
||||||
str,
|
|
||||||
]
|
|
||||||
]: ...
|
|
||||||
def __setattr__(
|
|
||||||
self,
|
|
||||||
name: str,
|
|
||||||
value: Optional[
|
|
||||||
Union[
|
|
||||||
Callable,
|
|
||||||
Dict[int, None],
|
|
||||||
Dict[int, str],
|
|
||||||
Dict[str, Callable],
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Optional[
|
|
||||||
Union[
|
|
||||||
Dict[str, Dict[str, Union[List[str], bool, str]]],
|
|
||||||
int,
|
|
||||||
]
|
|
||||||
],
|
|
||||||
],
|
|
||||||
Dict[str, Optional[str]],
|
|
||||||
Dict[str, Union[Dict[str, Optional[str]], str]],
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
Dict[str, Union[Callable, Dict[str, int], str]],
|
|
||||||
Dict[str, Union[Dict[str, int], int, str]],
|
|
||||||
],
|
|
||||||
],
|
|
||||||
List[
|
|
||||||
Dict[str, Union[Dict[str, List[Any]], List[Any], bool, str]]
|
|
||||||
],
|
|
||||||
List[Dict[str, Union[Dict[str, Tuple[str]], List[str], str]]],
|
|
||||||
List[
|
|
||||||
Union[
|
|
||||||
Dict[str, Union[Dict[Any, Any], bool, str]],
|
|
||||||
Dict[str, Union[Dict[str, bool], bool, str]],
|
|
||||||
]
|
|
||||||
],
|
|
||||||
List[
|
|
||||||
Union[
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
Dict[str, List[Tuple[str, Dict[str, str]]]], str
|
|
||||||
],
|
|
||||||
],
|
|
||||||
Dict[str, Union[Dict[str, int], str]],
|
|
||||||
]
|
|
||||||
],
|
|
||||||
List[
|
|
||||||
Union[
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[Dict[str, List[str]], List[str], bool, str],
|
|
||||||
],
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
Dict[str, Tuple[str, str]], List[str], bool, str
|
|
||||||
],
|
|
||||||
],
|
|
||||||
]
|
|
||||||
],
|
|
||||||
List[
|
|
||||||
Union[
|
|
||||||
Dict[str, Union[Dict[str, bool], str]],
|
|
||||||
Dict[str, Union[Dict[str, int], str]],
|
|
||||||
]
|
|
||||||
],
|
|
||||||
List[
|
|
||||||
Union[
|
|
||||||
Dict[str, Union[Dict[str, int], str]],
|
|
||||||
Dict[str, Union[Dict[str, str], str]],
|
|
||||||
]
|
|
||||||
],
|
|
||||||
List[Union[Tuple[str, str], str]],
|
|
||||||
List[int],
|
|
||||||
Tuple[Tuple[str, str], Tuple[str, str]],
|
|
||||||
Tuple[str],
|
|
||||||
Type[Any],
|
|
||||||
bytes,
|
|
||||||
Settings,
|
|
||||||
UserSettingsHolder,
|
|
||||||
float,
|
|
||||||
int,
|
|
||||||
str,
|
|
||||||
]
|
|
||||||
],
|
|
||||||
) -> None: ...
|
|
||||||
def __delattr__(self, name: str) -> None: ...
|
def __delattr__(self, name: str) -> None: ...
|
||||||
def __dir__(self) -> List[str]: ...
|
def __dir__(self) -> List[str]: ...
|
||||||
def is_overridden(self, setting: str) -> bool: ...
|
def is_overridden(self, setting: str) -> bool: ...
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ from django.db.models.base import Model
|
|||||||
from django.db.models.fields import BooleanField, DateField, Field
|
from django.db.models.fields import BooleanField, DateField, Field
|
||||||
from django.db.models.fields.mixins import FieldCacheMixin
|
from django.db.models.fields.mixins import FieldCacheMixin
|
||||||
from django.db.models.fields.related import RelatedField
|
from django.db.models.fields.related import RelatedField
|
||||||
|
from django.db.models.fields.reverse_related import ForeignObjectRel
|
||||||
from django.db.models.query import QuerySet
|
from django.db.models.query import QuerySet
|
||||||
|
|
||||||
|
|
||||||
@@ -47,7 +48,7 @@ class FieldListFilter(ListFilter):
|
|||||||
title: Any = ...
|
title: Any = ...
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
field: Union[Field, mixins.FieldCacheMixin],
|
field: Union[Field, ForeignObjectRel],
|
||||||
request: WSGIRequest,
|
request: WSGIRequest,
|
||||||
params: Dict[str, str],
|
params: Dict[str, str],
|
||||||
model: Type[Model],
|
model: Type[Model],
|
||||||
@@ -76,7 +77,7 @@ class FieldListFilter(ListFilter):
|
|||||||
@classmethod
|
@classmethod
|
||||||
def create(
|
def create(
|
||||||
cls,
|
cls,
|
||||||
field: Union[Field, mixins.FieldCacheMixin],
|
field: Union[Field, ForeignObjectRel],
|
||||||
request: WSGIRequest,
|
request: WSGIRequest,
|
||||||
params: Dict[str, str],
|
params: Dict[str, str],
|
||||||
model: Type[Model],
|
model: Type[Model],
|
||||||
|
|||||||
@@ -23,13 +23,7 @@ class LogEntryManager(models.Manager):
|
|||||||
action_flag: int,
|
action_flag: int,
|
||||||
change_message: Union[
|
change_message: Union[
|
||||||
Dict[str, Dict[str, List[str]]],
|
Dict[str, Dict[str, List[str]]],
|
||||||
List[
|
List[Dict[str, Dict[str, Union[List[str], str]]]],
|
||||||
Union[
|
|
||||||
Dict[str, Dict[str, List[str]]],
|
|
||||||
Dict[str, Dict[str, Union[List[str], str]]],
|
|
||||||
Dict[str, Dict[str, str]],
|
|
||||||
]
|
|
||||||
],
|
|
||||||
str,
|
str,
|
||||||
] = ...,
|
] = ...,
|
||||||
) -> LogEntry: ...
|
) -> LogEntry: ...
|
||||||
|
|||||||
@@ -100,14 +100,7 @@ class BaseModelAdmin:
|
|||||||
],
|
],
|
||||||
Tuple[Tuple[None, Dict[str, Tuple[Tuple[str, str]]]]],
|
Tuple[Tuple[None, Dict[str, Tuple[Tuple[str, str]]]]],
|
||||||
Tuple[
|
Tuple[
|
||||||
Tuple[str, Dict[str, Union[Tuple[str, str], Tuple[str]]]],
|
Tuple[str, Dict[str, Tuple[str]]], Tuple[str, Dict[str, Tuple[str]]]
|
||||||
Tuple[
|
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
Dict[str, Union[Tuple[str, str, str], Tuple[str]]],
|
|
||||||
Dict[str, Union[Tuple[str, str], Tuple[str]]],
|
|
||||||
],
|
|
||||||
],
|
|
||||||
],
|
],
|
||||||
]: ...
|
]: ...
|
||||||
def get_ordering(self, request: WSGIRequest) -> Union[List[str], Tuple]: ...
|
def get_ordering(self, request: WSGIRequest) -> Union[List[str], Tuple]: ...
|
||||||
@@ -137,16 +130,7 @@ class BaseModelAdmin:
|
|||||||
|
|
||||||
class ModelAdmin(BaseModelAdmin):
|
class ModelAdmin(BaseModelAdmin):
|
||||||
formfield_overrides: Dict[
|
formfield_overrides: Dict[
|
||||||
Type[
|
Type[Any],
|
||||||
Union[
|
|
||||||
django.db.models.fields.CharField,
|
|
||||||
django.db.models.fields.DateField,
|
|
||||||
django.db.models.fields.IntegerField,
|
|
||||||
django.db.models.fields.TextField,
|
|
||||||
django.db.models.fields.TimeField,
|
|
||||||
django.db.models.fields.files.FileField,
|
|
||||||
]
|
|
||||||
],
|
|
||||||
Dict[
|
Dict[
|
||||||
str,
|
str,
|
||||||
Type[
|
Type[
|
||||||
@@ -234,8 +218,7 @@ class ModelAdmin(BaseModelAdmin):
|
|||||||
request: WSGIRequest,
|
request: WSGIRequest,
|
||||||
object: Model,
|
object: Model,
|
||||||
message: Union[
|
message: Union[
|
||||||
Dict[str, Dict[Any, Any]],
|
Dict[str, Dict[Any, Any]], List[Dict[str, Dict[str, str]]]
|
||||||
List[Union[Dict[str, Dict[Any, Any]], Dict[str, Dict[str, str]]]],
|
|
||||||
],
|
],
|
||||||
) -> LogEntry: ...
|
) -> LogEntry: ...
|
||||||
def log_change(
|
def log_change(
|
||||||
@@ -244,13 +227,7 @@ class ModelAdmin(BaseModelAdmin):
|
|||||||
object: Model,
|
object: Model,
|
||||||
message: Union[
|
message: Union[
|
||||||
Dict[str, Dict[str, List[str]]],
|
Dict[str, Dict[str, List[str]]],
|
||||||
List[
|
List[Dict[str, Dict[str, Union[List[str], str]]]],
|
||||||
Union[
|
|
||||||
Dict[str, Dict[str, List[str]]],
|
|
||||||
Dict[str, Dict[str, Union[List[str], str]]],
|
|
||||||
Dict[str, Dict[str, str]],
|
|
||||||
]
|
|
||||||
],
|
|
||||||
],
|
],
|
||||||
) -> LogEntry: ...
|
) -> LogEntry: ...
|
||||||
def log_deletion(
|
def log_deletion(
|
||||||
|
|||||||
@@ -40,14 +40,7 @@ def result_list(
|
|||||||
) -> Dict[
|
) -> Dict[
|
||||||
str,
|
str,
|
||||||
Union[
|
Union[
|
||||||
List[
|
List[Dict[str, Optional[Union[int, str]]]],
|
||||||
Union[
|
|
||||||
Dict[str, Optional[Union[int, str]]],
|
|
||||||
Dict[str, Union[bool, SafeText]],
|
|
||||||
Dict[str, Union[bool, str]],
|
|
||||||
Dict[str, Union[int, str]],
|
|
||||||
]
|
|
||||||
],
|
|
||||||
List[ResultList],
|
List[ResultList],
|
||||||
List[BoundField],
|
List[BoundField],
|
||||||
ChangeList,
|
ChangeList,
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
from datetime import date, datetime
|
from datetime import date, datetime
|
||||||
from decimal import Decimal
|
|
||||||
from typing import Any, Callable, Dict, List, Optional, Set, Tuple, Type, Union
|
from typing import Any, Callable, Dict, List, Optional, Set, Tuple, Type, Union
|
||||||
from uuid import UUID
|
from uuid import UUID
|
||||||
|
|
||||||
@@ -11,10 +10,8 @@ from django.core.handlers.wsgi import WSGIRequest
|
|||||||
from django.db.models.base import Model
|
from django.db.models.base import Model
|
||||||
from django.db.models.deletion import Collector
|
from django.db.models.deletion import Collector
|
||||||
from django.db.models.fields import Field
|
from django.db.models.fields import Field
|
||||||
from django.db.models.fields.files import FieldFile
|
|
||||||
from django.db.models.fields.mixins import FieldCacheMixin
|
from django.db.models.fields.mixins import FieldCacheMixin
|
||||||
from django.db.models.fields.reverse_related import (ForeignObjectRel,
|
from django.db.models.fields.reverse_related import ManyToOneRel, OneToOneRel
|
||||||
ManyToOneRel)
|
|
||||||
from django.db.models.options import Options
|
from django.db.models.options import Options
|
||||||
from django.db.models.query import QuerySet
|
from django.db.models.query import QuerySet
|
||||||
|
|
||||||
@@ -48,28 +45,20 @@ def flatten_fieldsets(
|
|||||||
],
|
],
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
List[Tuple[str, Dict[str, Union[Tuple[str, str], Tuple[str]]]]],
|
List[Tuple[str, Dict[str, Tuple[str]]]],
|
||||||
Tuple[
|
Tuple[
|
||||||
Tuple[
|
Union[
|
||||||
None,
|
Tuple[Dict[str, Tuple[str]], Dict[str, Tuple[str]]],
|
||||||
Union[
|
Tuple[
|
||||||
Dict[str, Tuple[Tuple[str, str]]],
|
None,
|
||||||
Dict[str, Tuple[str, str, List[str]]],
|
Union[
|
||||||
Dict[str, Tuple[str, str, Tuple[str, str]]],
|
Dict[str, Tuple[Tuple[str, str]]],
|
||||||
Dict[str, Union[Tuple[str, str, str], Tuple[str]]],
|
Dict[str, Tuple[str, str, List[str]]],
|
||||||
|
Dict[str, Tuple[str, str, Tuple[str, str]]],
|
||||||
|
],
|
||||||
],
|
],
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
Tuple[
|
|
||||||
Tuple[str, Dict[str, Union[Tuple[str, str], Tuple[str]]]],
|
|
||||||
Tuple[
|
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
Dict[str, Union[Tuple[str, str, str], Tuple[str]]],
|
|
||||||
Dict[str, Union[Tuple[str, str], Tuple[str]]],
|
|
||||||
],
|
|
||||||
],
|
|
||||||
],
|
|
||||||
]
|
]
|
||||||
) -> List[Union[Callable, str]]: ...
|
) -> List[Union[Callable, str]]: ...
|
||||||
def get_deleted_objects(
|
def get_deleted_objects(
|
||||||
@@ -112,12 +101,9 @@ def model_ngettext(
|
|||||||
def lookup_field(
|
def lookup_field(
|
||||||
name: Union[Callable, str], obj: Model, model_admin: BaseModelAdmin = ...
|
name: Union[Callable, str], obj: Model, model_admin: BaseModelAdmin = ...
|
||||||
) -> Union[
|
) -> Union[
|
||||||
Tuple[None, Callable, Optional[Union[Callable, date, int, str]]],
|
Tuple[None, Callable, Optional[Callable]],
|
||||||
Tuple[
|
Tuple[None, Union[date, Model, int, str], Union[date, Model, int, str]],
|
||||||
Optional[Union[date, Model, FieldFile, float, int, str]],
|
Tuple[Field, None, Any],
|
||||||
Optional[Union[date, Model, FieldFile, float, int, str]],
|
|
||||||
Optional[Union[date, Model, FieldFile, float, int, str]],
|
|
||||||
],
|
|
||||||
]: ...
|
]: ...
|
||||||
def label_for_field(
|
def label_for_field(
|
||||||
name: Union[Callable, str],
|
name: Union[Callable, str],
|
||||||
@@ -125,35 +111,32 @@ def label_for_field(
|
|||||||
model_admin: Optional[BaseModelAdmin] = ...,
|
model_admin: Optional[BaseModelAdmin] = ...,
|
||||||
return_attr: bool = ...,
|
return_attr: bool = ...,
|
||||||
) -> Union[
|
) -> Union[
|
||||||
Tuple[Callable, Callable],
|
Tuple[
|
||||||
Tuple[str, Optional[Union[Type[str], GenericForeignKey]]],
|
Optional[Union[Callable, GenericForeignKey]],
|
||||||
|
Optional[Union[Callable, GenericForeignKey]],
|
||||||
|
],
|
||||||
|
Tuple[str, Type[str]],
|
||||||
str,
|
str,
|
||||||
]: ...
|
]: ...
|
||||||
def help_text_for_field(name: str, model: Type[Model]) -> str: ...
|
def help_text_for_field(name: str, model: Type[Model]) -> str: ...
|
||||||
def display_for_field(
|
def display_for_field(
|
||||||
value: Optional[Union[date, Decimal, Model, FieldFile, float, int, str]],
|
value: Any, field: Union[Field, OneToOneRel], empty_value_display: str
|
||||||
field: Union[Field, mixins.FieldCacheMixin],
|
|
||||||
empty_value_display: str,
|
|
||||||
) -> str: ...
|
) -> str: ...
|
||||||
def display_for_value(
|
def display_for_value(
|
||||||
value: Optional[
|
value: Any, empty_value_display: str, boolean: bool = ...
|
||||||
Union[Callable, List[Union[int, str]], date, Model, FieldFile, int, str]
|
|
||||||
],
|
|
||||||
empty_value_display: str,
|
|
||||||
boolean: bool = ...,
|
|
||||||
) -> str: ...
|
) -> str: ...
|
||||||
|
|
||||||
class NotRelationField(Exception): ...
|
class NotRelationField(Exception): ...
|
||||||
|
|
||||||
def get_model_from_relation(
|
def get_model_from_relation(
|
||||||
field: Union[Field, ForeignObjectRel]
|
field: Union[Field, mixins.FieldCacheMixin]
|
||||||
) -> Type[Model]: ...
|
) -> Type[Model]: ...
|
||||||
def reverse_field_path(
|
def reverse_field_path(
|
||||||
model: Type[Model], path: str
|
model: Type[Model], path: str
|
||||||
) -> Tuple[Type[Model], str]: ...
|
) -> Tuple[Type[Model], str]: ...
|
||||||
def get_fields_from_path(
|
def get_fields_from_path(
|
||||||
model: Type[Model], path: str
|
model: Type[Model], path: str
|
||||||
) -> List[Union[Field, ForeignObjectRel]]: ...
|
) -> List[Union[Field, mixins.FieldCacheMixin]]: ...
|
||||||
def construct_change_message(
|
def construct_change_message(
|
||||||
form: AdminPasswordChangeForm, formsets: None, add: bool
|
form: AdminPasswordChangeForm, formsets: None, add: bool
|
||||||
) -> List[Dict[str, Dict[str, List[str]]]]: ...
|
) -> List[Dict[str, Dict[str, List[str]]]]: ...
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
from collections import OrderedDict
|
from collections import OrderedDict
|
||||||
from datetime import datetime
|
|
||||||
from typing import Any, Callable, Dict, List, Optional, Tuple, Type, Union
|
from typing import Any, Callable, Dict, List, Optional, Tuple, Type, Union
|
||||||
|
|
||||||
from django.contrib.admin.filters import FieldListFilter, SimpleListFilter
|
from django.contrib.admin.filters import ListFilter, SimpleListFilter
|
||||||
from django.contrib.admin.options import ModelAdmin
|
from django.contrib.admin.options import ModelAdmin
|
||||||
from django.core.handlers.wsgi import WSGIRequest
|
from django.core.handlers.wsgi import WSGIRequest
|
||||||
from django.db.models.base import Model
|
from django.db.models.base import Model
|
||||||
from django.db.models.expressions import BaseExpression, CombinedExpression, F
|
from django.db.models.expressions import (Combinable, CombinedExpression,
|
||||||
|
OrderBy)
|
||||||
from django.db.models.query import QuerySet
|
from django.db.models.query import QuerySet
|
||||||
|
|
||||||
ALL_VAR: str
|
ALL_VAR: str
|
||||||
@@ -64,16 +64,7 @@ class ChangeList:
|
|||||||
def get_filters_params(self, params: None = ...) -> Dict[str, str]: ...
|
def get_filters_params(self, params: None = ...) -> Dict[str, str]: ...
|
||||||
def get_filters(
|
def get_filters(
|
||||||
self, request: WSGIRequest
|
self, request: WSGIRequest
|
||||||
) -> Union[
|
) -> Tuple[List[ListFilter], bool, bool, bool]: ...
|
||||||
Tuple[List[Any], bool, Dict[str, datetime], bool],
|
|
||||||
Tuple[
|
|
||||||
List[Union[FieldListFilter, SimpleListFilter]],
|
|
||||||
bool,
|
|
||||||
Dict[str, bool],
|
|
||||||
bool,
|
|
||||||
],
|
|
||||||
Tuple[List[FieldListFilter], bool, Dict[str, str], bool],
|
|
||||||
]: ...
|
|
||||||
def get_query_string(
|
def get_query_string(
|
||||||
self,
|
self,
|
||||||
new_params: Optional[
|
new_params: Optional[
|
||||||
@@ -95,7 +86,7 @@ class ChangeList:
|
|||||||
) -> Optional[Union[CombinedExpression, str]]: ...
|
) -> Optional[Union[CombinedExpression, str]]: ...
|
||||||
def get_ordering(
|
def get_ordering(
|
||||||
self, request: WSGIRequest, queryset: QuerySet
|
self, request: WSGIRequest, queryset: QuerySet
|
||||||
) -> List[Union[BaseExpression, F, str]]: ...
|
) -> Union[List[Union[Combinable, str]], List[Union[OrderBy, str]]]: ...
|
||||||
def get_ordering_field_columns(self) -> OrderedDict: ...
|
def get_ordering_field_columns(self) -> OrderedDict: ...
|
||||||
def get_queryset(self, request: WSGIRequest) -> QuerySet: ...
|
def get_queryset(self, request: WSGIRequest) -> QuerySet: ...
|
||||||
def apply_select_related(self, qs: QuerySet) -> QuerySet: ...
|
def apply_select_related(self, qs: QuerySet) -> QuerySet: ...
|
||||||
|
|||||||
@@ -1,19 +1,14 @@
|
|||||||
from collections import OrderedDict
|
from collections import OrderedDict
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from typing import Any, Callable, Dict, List, Optional, Set, Tuple, Union
|
from typing import Any, Callable, Dict, List, Optional, Tuple, Union
|
||||||
from uuid import UUID
|
from uuid import UUID
|
||||||
|
|
||||||
from django import forms
|
from django import forms
|
||||||
from django.contrib.admin.sites import AdminSite, DefaultAdminSite
|
from django.contrib.admin.sites import AdminSite, DefaultAdminSite
|
||||||
from django.contrib.auth.forms import (ReadOnlyPasswordHashField,
|
|
||||||
ReadOnlyPasswordHashWidget)
|
|
||||||
from django.db.models.fields.reverse_related import ForeignObjectRel
|
from django.db.models.fields.reverse_related import ForeignObjectRel
|
||||||
from django.db.models.query_utils import Q
|
from django.db.models.query_utils import Q
|
||||||
from django.forms.fields import (BooleanField, CharField, Field, FileField,
|
from django.forms.fields import Field
|
||||||
IntegerField, SplitDateTimeField, URLField)
|
from django.forms.widgets import ChoiceWidget, Media, Widget
|
||||||
from django.forms.models import ModelChoiceField, ModelMultipleChoiceField
|
|
||||||
from django.forms.widgets import (CheckboxInput, ChoiceWidget, DateInput,
|
|
||||||
Media, Select, TimeInput, Widget)
|
|
||||||
from django.http.request import QueryDict
|
from django.http.request import QueryDict
|
||||||
from django.utils.datastructures import MultiValueDict
|
from django.utils.datastructures import MultiValueDict
|
||||||
|
|
||||||
@@ -35,24 +30,29 @@ class FilteredSelectMultiple(forms.SelectMultiple):
|
|||||||
name: str,
|
name: str,
|
||||||
value: Union[List[Any], str],
|
value: Union[List[Any], str],
|
||||||
attrs: Optional[Dict[str, str]],
|
attrs: Optional[Dict[str, str]],
|
||||||
) -> Dict[
|
) -> Union[
|
||||||
str,
|
|
||||||
Dict[
|
Dict[
|
||||||
str,
|
str,
|
||||||
Union[
|
Dict[
|
||||||
Dict[str, Union[int, str]],
|
|
||||||
List[
|
|
||||||
Tuple[
|
|
||||||
None,
|
|
||||||
List[Dict[str, Union[Dict[Any, Any], int, str]]],
|
|
||||||
int,
|
|
||||||
]
|
|
||||||
],
|
|
||||||
List[str],
|
|
||||||
bool,
|
|
||||||
str,
|
str,
|
||||||
|
Union[
|
||||||
|
Dict[str, Union[int, str]],
|
||||||
|
List[
|
||||||
|
Tuple[
|
||||||
|
None,
|
||||||
|
List[Dict[str, Union[Dict[Any, Any], int, str]]],
|
||||||
|
int,
|
||||||
|
]
|
||||||
|
],
|
||||||
|
bool,
|
||||||
|
str,
|
||||||
|
],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
|
Dict[
|
||||||
|
str,
|
||||||
|
Dict[str, Union[Dict[str, Union[int, str]], List[str], bool, str]],
|
||||||
|
],
|
||||||
]: ...
|
]: ...
|
||||||
|
|
||||||
class AdminDateWidget(forms.DateInput):
|
class AdminDateWidget(forms.DateInput):
|
||||||
@@ -291,62 +291,8 @@ class RelatedFieldWidgetWrapper(forms.Widget):
|
|||||||
) -> None: ...
|
) -> None: ...
|
||||||
def __deepcopy__(
|
def __deepcopy__(
|
||||||
self,
|
self,
|
||||||
memo: Union[
|
memo: Dict[
|
||||||
Dict[
|
int, Union[List[Union[Field, Widget]], OrderedDict, Field, Widget]
|
||||||
int,
|
|
||||||
Union[
|
|
||||||
List[
|
|
||||||
Union[
|
|
||||||
AdminEmailInputWidget,
|
|
||||||
AdminTextInputWidget,
|
|
||||||
FilteredSelectMultiple,
|
|
||||||
RelatedFieldWidgetWrapper,
|
|
||||||
ReadOnlyPasswordHashField,
|
|
||||||
ReadOnlyPasswordHashWidget,
|
|
||||||
BooleanField,
|
|
||||||
CharField,
|
|
||||||
ModelMultipleChoiceField,
|
|
||||||
CheckboxInput,
|
|
||||||
]
|
|
||||||
],
|
|
||||||
List[
|
|
||||||
Union[
|
|
||||||
AdminFileWidget,
|
|
||||||
AdminTextInputWidget,
|
|
||||||
CharField,
|
|
||||||
FileField,
|
|
||||||
]
|
|
||||||
],
|
|
||||||
List[Union[AdminIntegerFieldWidget, IntegerField]],
|
|
||||||
List[
|
|
||||||
Union[
|
|
||||||
AdminSplitDateTime,
|
|
||||||
AdminTextInputWidget,
|
|
||||||
AdminTextareaWidget,
|
|
||||||
RelatedFieldWidgetWrapper,
|
|
||||||
CharField,
|
|
||||||
SplitDateTimeField,
|
|
||||||
ModelChoiceField,
|
|
||||||
DateInput,
|
|
||||||
Select,
|
|
||||||
TimeInput,
|
|
||||||
]
|
|
||||||
],
|
|
||||||
OrderedDict,
|
|
||||||
Field,
|
|
||||||
Widget,
|
|
||||||
],
|
|
||||||
],
|
|
||||||
Dict[
|
|
||||||
int,
|
|
||||||
Union[
|
|
||||||
List[Union[AdminURLFieldWidget, URLField]],
|
|
||||||
OrderedDict,
|
|
||||||
AdminURLFieldWidget,
|
|
||||||
URLField,
|
|
||||||
ModelChoiceField,
|
|
||||||
],
|
|
||||||
],
|
|
||||||
],
|
],
|
||||||
) -> RelatedFieldWidgetWrapper: ...
|
) -> RelatedFieldWidgetWrapper: ...
|
||||||
@property
|
@property
|
||||||
@@ -432,18 +378,7 @@ class AutocompleteMixin:
|
|||||||
name: str,
|
name: str,
|
||||||
value: List[str],
|
value: List[str],
|
||||||
attr: Dict[str, Union[bool, str]] = ...,
|
attr: Dict[str, Union[bool, str]] = ...,
|
||||||
) -> List[
|
) -> List[Tuple[None, int, int]]: ...
|
||||||
Tuple[
|
|
||||||
None,
|
|
||||||
List[
|
|
||||||
Union[
|
|
||||||
Dict[str, Union[Dict[Any, Any], bool, str]],
|
|
||||||
Dict[str, Union[Dict[str, bool], Set[str], int, str]],
|
|
||||||
]
|
|
||||||
],
|
|
||||||
int,
|
|
||||||
]
|
|
||||||
]: ...
|
|
||||||
@property
|
@property
|
||||||
def media(self) -> Media: ...
|
def media(self) -> Media: ...
|
||||||
|
|
||||||
|
|||||||
@@ -14,16 +14,7 @@ sensitive_post_parameters_m: Any
|
|||||||
class GroupAdmin(admin.ModelAdmin):
|
class GroupAdmin(admin.ModelAdmin):
|
||||||
admin_site: django.contrib.admin.sites.AdminSite
|
admin_site: django.contrib.admin.sites.AdminSite
|
||||||
formfield_overrides: Dict[
|
formfield_overrides: Dict[
|
||||||
Type[
|
Type[Any],
|
||||||
Union[
|
|
||||||
django.db.models.fields.CharField,
|
|
||||||
django.db.models.fields.DateField,
|
|
||||||
django.db.models.fields.IntegerField,
|
|
||||||
django.db.models.fields.TextField,
|
|
||||||
django.db.models.fields.TimeField,
|
|
||||||
django.db.models.fields.files.FileField,
|
|
||||||
]
|
|
||||||
],
|
|
||||||
Dict[
|
Dict[
|
||||||
str,
|
str,
|
||||||
Type[
|
Type[
|
||||||
@@ -49,16 +40,7 @@ class GroupAdmin(admin.ModelAdmin):
|
|||||||
class UserAdmin(admin.ModelAdmin):
|
class UserAdmin(admin.ModelAdmin):
|
||||||
admin_site: django.contrib.admin.sites.AdminSite
|
admin_site: django.contrib.admin.sites.AdminSite
|
||||||
formfield_overrides: Dict[
|
formfield_overrides: Dict[
|
||||||
Type[
|
Type[Any],
|
||||||
Union[
|
|
||||||
django.db.models.fields.CharField,
|
|
||||||
django.db.models.fields.DateField,
|
|
||||||
django.db.models.fields.IntegerField,
|
|
||||||
django.db.models.fields.TextField,
|
|
||||||
django.db.models.fields.TimeField,
|
|
||||||
django.db.models.fields.files.FileField,
|
|
||||||
]
|
|
||||||
],
|
|
||||||
Dict[
|
Dict[
|
||||||
str,
|
str,
|
||||||
Type[
|
Type[
|
||||||
|
|||||||
@@ -11,9 +11,7 @@ def get_default_password_validators() -> Union[
|
|||||||
List[NumericPasswordValidator],
|
List[NumericPasswordValidator],
|
||||||
]: ...
|
]: ...
|
||||||
def get_password_validators(
|
def get_password_validators(
|
||||||
validator_config: List[
|
validator_config: List[Dict[str, Union[Dict[str, int], str]]]
|
||||||
Union[Dict[str, Union[Dict[str, int], str]], Dict[str, str]]
|
|
||||||
]
|
|
||||||
) -> Union[
|
) -> Union[
|
||||||
List[Union[CommonPasswordValidator, MinimumLengthValidator]],
|
List[Union[CommonPasswordValidator, MinimumLengthValidator]],
|
||||||
List[Union[MinimumLengthValidator, UserAttributeSimilarityValidator]],
|
List[Union[MinimumLengthValidator, UserAttributeSimilarityValidator]],
|
||||||
@@ -48,7 +46,7 @@ class UserAttributeSimilarityValidator:
|
|||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
user_attributes: Union[List[str], Tuple[str, str, str, str]] = ...,
|
user_attributes: Union[List[str], Tuple[str, str, str, str]] = ...,
|
||||||
max_similarity: Union[float, int] = ...,
|
max_similarity: float = ...,
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
def validate(self, password: str, user: Optional[User] = ...) -> None: ...
|
def validate(self, password: str, user: Optional[User] = ...) -> None: ...
|
||||||
def get_help_text(self) -> str: ...
|
def get_help_text(self) -> str: ...
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ from django.core.handlers.wsgi import WSGIRequest
|
|||||||
from django.http.request import HttpRequest
|
from django.http.request import HttpRequest
|
||||||
from django.http.response import HttpResponse, HttpResponseRedirect
|
from django.http.response import HttpResponse, HttpResponseRedirect
|
||||||
from django.template.response import TemplateResponse
|
from django.template.response import TemplateResponse
|
||||||
from django.utils.datastructures import MultiValueDict
|
|
||||||
from django.views.generic.base import TemplateView
|
from django.views.generic.base import TemplateView
|
||||||
from django.views.generic.edit import FormView
|
from django.views.generic.edit import FormView
|
||||||
|
|
||||||
@@ -35,12 +34,7 @@ class LoginView(SuccessURLAllowedHostsMixin, FormView):
|
|||||||
def get_form_class(self) -> Type[AuthenticationForm]: ...
|
def get_form_class(self) -> Type[AuthenticationForm]: ...
|
||||||
def get_form_kwargs(
|
def get_form_kwargs(
|
||||||
self
|
self
|
||||||
) -> Dict[
|
) -> Dict[str, Optional[Union[Dict[str, str], HttpRequest]]]: ...
|
||||||
str,
|
|
||||||
Optional[
|
|
||||||
Union[Dict[Any, Any], Dict[str, str], HttpRequest, MultiValueDict]
|
|
||||||
],
|
|
||||||
]: ...
|
|
||||||
def form_valid(self, form: AuthenticationForm) -> HttpResponseRedirect: ...
|
def form_valid(self, form: AuthenticationForm) -> HttpResponseRedirect: ...
|
||||||
def get_context_data(
|
def get_context_data(
|
||||||
self, **kwargs: Any
|
self, **kwargs: Any
|
||||||
@@ -111,9 +105,7 @@ class PasswordResetConfirmView(PasswordContextMixin, FormView):
|
|||||||
def get_user(self, uidb64: str) -> Optional[AbstractBaseUser]: ...
|
def get_user(self, uidb64: str) -> Optional[AbstractBaseUser]: ...
|
||||||
def get_form_kwargs(
|
def get_form_kwargs(
|
||||||
self
|
self
|
||||||
) -> Dict[
|
) -> Dict[str, Optional[Union[Dict[Any, Any], AbstractBaseUser]]]: ...
|
||||||
str, Optional[Union[Dict[Any, Any], AbstractBaseUser, MultiValueDict]]
|
|
||||||
]: ...
|
|
||||||
def form_valid(self, form: SetPasswordForm) -> HttpResponseRedirect: ...
|
def form_valid(self, form: SetPasswordForm) -> HttpResponseRedirect: ...
|
||||||
def get_context_data(self, **kwargs: Any): ...
|
def get_context_data(self, **kwargs: Any): ...
|
||||||
|
|
||||||
|
|||||||
@@ -1,55 +1,43 @@
|
|||||||
from typing import Dict, List, Optional, Tuple, Type, Union
|
from typing import Any, Dict, List, Optional, Tuple, Type
|
||||||
|
|
||||||
from django.apps.config import AppConfig
|
from django.apps.config import AppConfig
|
||||||
from django.apps.registry import Apps
|
from django.apps.registry import Apps
|
||||||
from django.contrib.admin.migrations.0001_initial import Migration
|
|
||||||
from django.contrib.admin.migrations.0002_logentry_remove_auto_add import \
|
|
||||||
Migration
|
|
||||||
from django.contrib.admin.migrations.0003_logentry_add_action_flag_choices import \
|
|
||||||
Migration
|
|
||||||
from django.contrib.contenttypes.models import ContentType
|
from django.contrib.contenttypes.models import ContentType
|
||||||
from django.contrib.sites.migrations.0001_initial import Migration
|
from django.db import migrations
|
||||||
from django.contrib.sites.migrations.0002_alter_domain_unique import Migration
|
|
||||||
from django.db.backends.sqlite3.schema import DatabaseSchemaEditor
|
from django.db.backends.sqlite3.schema import DatabaseSchemaEditor
|
||||||
from django.db.migrations.migration import Migration
|
from django.db.migrations.migration import Migration
|
||||||
from django.db.migrations.state import StateApps
|
from django.db.migrations.state import StateApps
|
||||||
from django.db.models.base import Model
|
from django.db.models.base import Model
|
||||||
|
|
||||||
|
|
||||||
|
class RenameContentType(migrations.RunPython):
|
||||||
|
app_label: Any = ...
|
||||||
|
old_model: Any = ...
|
||||||
|
new_model: Any = ...
|
||||||
|
def __init__(
|
||||||
|
self, app_label: str, old_model: str, new_model: str
|
||||||
|
) -> None: ...
|
||||||
|
def rename_forward(
|
||||||
|
self, apps: StateApps, schema_editor: DatabaseSchemaEditor
|
||||||
|
) -> None: ...
|
||||||
|
def rename_backward(
|
||||||
|
self, apps: StateApps, schema_editor: DatabaseSchemaEditor
|
||||||
|
) -> None: ...
|
||||||
|
|
||||||
|
def inject_rename_contenttypes_operations(
|
||||||
|
plan: List[Tuple[Migration, bool]] = ...,
|
||||||
|
apps: StateApps = ...,
|
||||||
|
using: str = ...,
|
||||||
|
**kwargs: Any
|
||||||
|
) -> None: ...
|
||||||
|
def get_contenttypes_and_models(
|
||||||
|
app_config: AppConfig, using: str, ContentType: Type[ContentType]
|
||||||
|
) -> Tuple[Dict[str, ContentType], Dict[str, Type[Model]]]: ...
|
||||||
def create_contenttypes(
|
def create_contenttypes(
|
||||||
app_config: AppConfig,
|
app_config: AppConfig,
|
||||||
verbosity: int = ...,
|
verbosity: int = ...,
|
||||||
interactive: bool = ...,
|
interactive: bool = ...,
|
||||||
using: str = ...,
|
using: str = ...,
|
||||||
apps: Apps = ...,
|
apps: Apps = ...,
|
||||||
**kwargs
|
**kwargs: Any
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
|
|
||||||
|
|
||||||
def get_contenttypes_and_models(
|
|
||||||
app_config: AppConfig,
|
|
||||||
using: str,
|
|
||||||
ContentType: Type[ContentType]
|
|
||||||
) -> Tuple[Dict[str, ContentType], Dict[str, Type[Model]]]: ...
|
|
||||||
|
|
||||||
|
|
||||||
def inject_rename_contenttypes_operations(
|
|
||||||
plan: List[Union[Tuple[Migration, bool], Tuple[Migration, bool], Tuple[Migration, bool], Tuple[Migration, bool], Tuple[Migration, bool], Tuple[Migration, bool]]] = ...,
|
|
||||||
apps: StateApps = ...,
|
|
||||||
using: str = ...,
|
|
||||||
**kwargs
|
|
||||||
) -> None: ...
|
|
||||||
|
|
||||||
|
|
||||||
class RenameContentType:
|
|
||||||
def __init__(self, app_label: str, old_model: str, new_model: str) -> None: ...
|
|
||||||
def rename_backward(
|
|
||||||
self,
|
|
||||||
apps: StateApps,
|
|
||||||
schema_editor: DatabaseSchemaEditor
|
|
||||||
) -> None: ...
|
|
||||||
def rename_forward(
|
|
||||||
self,
|
|
||||||
apps: StateApps,
|
|
||||||
schema_editor: DatabaseSchemaEditor
|
|
||||||
) -> None: ...
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ register: Any
|
|||||||
|
|
||||||
def ordinal(value: Optional[str]) -> Optional[str]: ...
|
def ordinal(value: Optional[str]) -> Optional[str]: ...
|
||||||
def intcomma(
|
def intcomma(
|
||||||
value: Optional[Union[Decimal, float, int, str]], use_l10n: bool = ...
|
value: Optional[Union[Decimal, float, str]], use_l10n: bool = ...
|
||||||
) -> str: ...
|
) -> str: ...
|
||||||
|
|
||||||
intword_converters: Any
|
intword_converters: Any
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
from typing import Any, Dict, List, Optional, Tuple, Union
|
from typing import Any, Dict, List, Optional, Tuple, Union
|
||||||
|
|
||||||
from django.contrib.postgres import lookups
|
from django.contrib.postgres import lookups
|
||||||
|
from django.contrib.postgres.fields.mixins import CheckFieldDefaultMixin
|
||||||
from django.db.models import Field, Transform
|
from django.db.models import Field, Transform
|
||||||
from django.db.models.fields import Field
|
from django.db.models.fields import Field
|
||||||
from django.db.models.lookups import Exact, In
|
from django.db.models.lookups import Exact, In
|
||||||
@@ -16,7 +17,10 @@ class ArrayField(CheckFieldDefaultMixin, Field):
|
|||||||
default_validators: Any = ...
|
default_validators: Any = ...
|
||||||
from_db_value: Any = ...
|
from_db_value: Any = ...
|
||||||
def __init__(
|
def __init__(
|
||||||
self, base_field: Field, size: None = ..., **kwargs: Any
|
self,
|
||||||
|
base_field: Union[CheckFieldDefaultMixin, Field],
|
||||||
|
size: None = ...,
|
||||||
|
**kwargs: Any
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
@property
|
@property
|
||||||
def model(self): ...
|
def model(self): ...
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ class Command(BaseCommand):
|
|||||||
ignore_patterns: Any = ...
|
ignore_patterns: Any = ...
|
||||||
post_process: Any = ...
|
post_process: Any = ...
|
||||||
def set_options(self, **options: Any) -> None: ...
|
def set_options(self, **options: Any) -> None: ...
|
||||||
def collect(self) -> Dict[str, Union[List[Any], List[str]]]: ...
|
def collect(self) -> Dict[str, List[str]]: ...
|
||||||
def handle(self, **options: Any) -> Optional[str]: ...
|
def handle(self, **options: Any) -> Optional[str]: ...
|
||||||
def log(self, msg: str, level: int = ...) -> None: ...
|
def log(self, msg: str, level: int = ...) -> None: ...
|
||||||
def is_local_storage(self) -> bool: ...
|
def is_local_storage(self) -> bool: ...
|
||||||
|
|||||||
+3
-48
@@ -1,9 +1,6 @@
|
|||||||
from typing import Any, Callable, Dict, List, Optional, Tuple, Type, Union
|
from typing import Any, Callable, Dict, Optional, Union
|
||||||
|
|
||||||
from django.core.cache.backends.base import BaseCache
|
from django.core.cache.backends.base import BaseCache
|
||||||
from django.db.models.base import Model
|
|
||||||
from django.db.models.query import QuerySet
|
|
||||||
from django.http.response import HttpResponse
|
|
||||||
|
|
||||||
|
|
||||||
class Options:
|
class Options:
|
||||||
@@ -46,53 +43,11 @@ class DatabaseCache(BaseDatabaseCache):
|
|||||||
key: str,
|
key: str,
|
||||||
default: Optional[Union[int, str]] = ...,
|
default: Optional[Union[int, str]] = ...,
|
||||||
version: Optional[int] = ...,
|
version: Optional[int] = ...,
|
||||||
) -> Optional[
|
) -> Any: ...
|
||||||
Union[
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
Callable,
|
|
||||||
Dict[str, int],
|
|
||||||
List[int],
|
|
||||||
Tuple[int, int, int, int],
|
|
||||||
Type[Any],
|
|
||||||
int,
|
|
||||||
str,
|
|
||||||
],
|
|
||||||
],
|
|
||||||
List[Any],
|
|
||||||
bytes,
|
|
||||||
Model,
|
|
||||||
QuerySet,
|
|
||||||
HttpResponse,
|
|
||||||
int,
|
|
||||||
str,
|
|
||||||
]
|
|
||||||
]: ...
|
|
||||||
def set(
|
def set(
|
||||||
self,
|
self,
|
||||||
key: str,
|
key: str,
|
||||||
value: Union[
|
value: Any,
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
Callable,
|
|
||||||
Dict[str, int],
|
|
||||||
List[int],
|
|
||||||
Tuple[int, int, int, int],
|
|
||||||
Type[Any],
|
|
||||||
int,
|
|
||||||
str,
|
|
||||||
],
|
|
||||||
],
|
|
||||||
List[Any],
|
|
||||||
bytes,
|
|
||||||
Model,
|
|
||||||
QuerySet,
|
|
||||||
HttpResponse,
|
|
||||||
int,
|
|
||||||
str,
|
|
||||||
],
|
|
||||||
timeout: Any = ...,
|
timeout: Any = ...,
|
||||||
version: Optional[int] = ...,
|
version: Optional[int] = ...,
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
|
|||||||
+2
-17
@@ -1,4 +1,4 @@
|
|||||||
from typing import Any, Callable, Dict, List, Optional, Tuple, Type, Union
|
from typing import Any, Dict, Optional, Union
|
||||||
|
|
||||||
from django.core.cache.backends.base import BaseCache
|
from django.core.cache.backends.base import BaseCache
|
||||||
|
|
||||||
@@ -21,22 +21,7 @@ class DummyCache(BaseCache):
|
|||||||
def set(
|
def set(
|
||||||
self,
|
self,
|
||||||
key: str,
|
key: str,
|
||||||
value: Union[
|
value: Union[Dict[str, Any], int, str],
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
Callable,
|
|
||||||
Dict[str, int],
|
|
||||||
List[int],
|
|
||||||
Tuple[int, int, int, int],
|
|
||||||
Type[Any],
|
|
||||||
int,
|
|
||||||
str,
|
|
||||||
],
|
|
||||||
],
|
|
||||||
int,
|
|
||||||
str,
|
|
||||||
],
|
|
||||||
timeout: Any = ...,
|
timeout: Any = ...,
|
||||||
version: Optional[str] = ...,
|
version: Optional[str] = ...,
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
|
|||||||
+2
-25
@@ -1,9 +1,6 @@
|
|||||||
from typing import Any, Callable, Dict, List, Optional, Tuple, Type, Union
|
from typing import Any, Callable, Dict, Optional, Union
|
||||||
|
|
||||||
from django.core.cache.backends.base import BaseCache
|
from django.core.cache.backends.base import BaseCache
|
||||||
from django.db.models.base import Model
|
|
||||||
from django.db.models.query import QuerySet
|
|
||||||
from django.http.response import HttpResponse
|
|
||||||
|
|
||||||
|
|
||||||
class FileBasedCache(BaseCache):
|
class FileBasedCache(BaseCache):
|
||||||
@@ -38,27 +35,7 @@ class FileBasedCache(BaseCache):
|
|||||||
def set(
|
def set(
|
||||||
self,
|
self,
|
||||||
key: str,
|
key: str,
|
||||||
value: Union[
|
value: Any,
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
Callable,
|
|
||||||
Dict[str, int],
|
|
||||||
List[int],
|
|
||||||
Tuple[int, int, int, int],
|
|
||||||
Type[Any],
|
|
||||||
int,
|
|
||||||
str,
|
|
||||||
],
|
|
||||||
],
|
|
||||||
List[Any],
|
|
||||||
bytes,
|
|
||||||
Model,
|
|
||||||
QuerySet,
|
|
||||||
HttpResponse,
|
|
||||||
int,
|
|
||||||
str,
|
|
||||||
],
|
|
||||||
timeout: Any = ...,
|
timeout: Any = ...,
|
||||||
version: Optional[int] = ...,
|
version: Optional[int] = ...,
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
|
|||||||
+3
-47
@@ -1,10 +1,7 @@
|
|||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from typing import Any, Callable, Dict, List, Optional, Tuple, Type, Union
|
from typing import Any, Callable, Dict, Optional, Union
|
||||||
|
|
||||||
from django.core.cache.backends.base import BaseCache
|
from django.core.cache.backends.base import BaseCache
|
||||||
from django.db.models.base import Model
|
|
||||||
from django.db.models.query import QuerySet
|
|
||||||
from django.http.response import HttpResponse
|
|
||||||
|
|
||||||
|
|
||||||
class LocMemCache(BaseCache):
|
class LocMemCache(BaseCache):
|
||||||
@@ -37,52 +34,11 @@ class LocMemCache(BaseCache):
|
|||||||
key: Union[int, str],
|
key: Union[int, str],
|
||||||
default: Optional[Union[int, str]] = ...,
|
default: Optional[Union[int, str]] = ...,
|
||||||
version: Optional[int] = ...,
|
version: Optional[int] = ...,
|
||||||
) -> Union[
|
) -> Any: ...
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
Callable,
|
|
||||||
Dict[str, int],
|
|
||||||
List[int],
|
|
||||||
Tuple[int, int, int, int],
|
|
||||||
Type[Any],
|
|
||||||
int,
|
|
||||||
str,
|
|
||||||
],
|
|
||||||
],
|
|
||||||
List[str],
|
|
||||||
bytes,
|
|
||||||
Model,
|
|
||||||
QuerySet,
|
|
||||||
HttpResponse,
|
|
||||||
int,
|
|
||||||
str,
|
|
||||||
]: ...
|
|
||||||
def set(
|
def set(
|
||||||
self,
|
self,
|
||||||
key: Union[int, str],
|
key: Union[int, str],
|
||||||
value: Union[
|
value: Any,
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
Callable,
|
|
||||||
Dict[str, int],
|
|
||||||
List[int],
|
|
||||||
Tuple[int, int, int, int],
|
|
||||||
Type[Any],
|
|
||||||
int,
|
|
||||||
str,
|
|
||||||
],
|
|
||||||
],
|
|
||||||
Dict[str, Union[datetime, str]],
|
|
||||||
List[str],
|
|
||||||
bytes,
|
|
||||||
Model,
|
|
||||||
QuerySet,
|
|
||||||
HttpResponse,
|
|
||||||
int,
|
|
||||||
str,
|
|
||||||
],
|
|
||||||
timeout: Any = ...,
|
timeout: Any = ...,
|
||||||
version: Optional[int] = ...,
|
version: Optional[int] = ...,
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
|
|||||||
@@ -1,10 +1,4 @@
|
|||||||
from typing import Any, Callable, Optional, Type, Union
|
from typing import Any, Optional, Union
|
||||||
|
|
||||||
from django.contrib.admin.options import ModelAdmin
|
|
||||||
from django.contrib.contenttypes.fields import GenericForeignKey
|
|
||||||
from django.db.models.base import Model
|
|
||||||
from django.db.models.fields import Field
|
|
||||||
from django.db.models.manager import Manager
|
|
||||||
|
|
||||||
DEBUG: int
|
DEBUG: int
|
||||||
INFO: int
|
INFO: int
|
||||||
@@ -23,16 +17,7 @@ class CheckMessage:
|
|||||||
level: int,
|
level: int,
|
||||||
msg: str,
|
msg: str,
|
||||||
hint: Optional[str] = ...,
|
hint: Optional[str] = ...,
|
||||||
obj: Optional[
|
obj: Any = ...,
|
||||||
Union[
|
|
||||||
Callable,
|
|
||||||
Type[Union[ModelAdmin, Model]],
|
|
||||||
GenericForeignKey,
|
|
||||||
Field,
|
|
||||||
Manager,
|
|
||||||
str,
|
|
||||||
]
|
|
||||||
] = ...,
|
|
||||||
id: Optional[str] = ...,
|
id: Optional[str] = ...,
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
def __eq__(self, other: Union[CheckMessage, str]) -> bool: ...
|
def __eq__(self, other: Union[CheckMessage, str]) -> bool: ...
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
from typing import Any, Callable, List, Optional, Set, Union
|
from typing import Any, Callable, List, Optional, Set, Union
|
||||||
|
|
||||||
from django.contrib.admin.apps import SimpleAdminConfig
|
from django.apps.config import AppConfig
|
||||||
from django.contrib.auth.apps import AuthConfig
|
|
||||||
from django.core.checks.messages import CheckMessage
|
from django.core.checks.messages import CheckMessage
|
||||||
|
|
||||||
|
|
||||||
@@ -28,7 +27,7 @@ class CheckRegistry:
|
|||||||
) -> Callable: ...
|
) -> Callable: ...
|
||||||
def run_checks(
|
def run_checks(
|
||||||
self,
|
self,
|
||||||
app_configs: Optional[List[Union[SimpleAdminConfig, AuthConfig]]] = ...,
|
app_configs: Optional[List[AppConfig]] = ...,
|
||||||
tags: Optional[List[str]] = ...,
|
tags: Optional[List[str]] = ...,
|
||||||
include_deployment_checks: bool = ...,
|
include_deployment_checks: bool = ...,
|
||||||
) -> Union[List[CheckMessage], List[int], List[str]]: ...
|
) -> Union[List[CheckMessage], List[int], List[str]]: ...
|
||||||
|
|||||||
@@ -1,7 +1,3 @@
|
|||||||
from http.client import HTTPResponse
|
|
||||||
from io import (BufferedRandom, BufferedReader, BufferedWriter, BytesIO,
|
|
||||||
StringIO, TextIOWrapper)
|
|
||||||
from tempfile import SpooledTemporaryFile, _TemporaryFileWrapper
|
|
||||||
from typing import Any, Iterator, Optional, Union
|
from typing import Any, Iterator, Optional, Union
|
||||||
|
|
||||||
from django.core.files.utils import FileProxyMixin
|
from django.core.files.utils import FileProxyMixin
|
||||||
@@ -12,23 +8,7 @@ class File(FileProxyMixin):
|
|||||||
file: _io.BufferedReader = ...
|
file: _io.BufferedReader = ...
|
||||||
name: str = ...
|
name: str = ...
|
||||||
mode: str = ...
|
mode: str = ...
|
||||||
def __init__(
|
def __init__(self, file: Any, name: Optional[str] = ...) -> None: ...
|
||||||
self,
|
|
||||||
file: Optional[
|
|
||||||
Union[
|
|
||||||
BufferedRandom,
|
|
||||||
BufferedReader,
|
|
||||||
BufferedWriter,
|
|
||||||
BytesIO,
|
|
||||||
StringIO,
|
|
||||||
TextIOWrapper,
|
|
||||||
HTTPResponse,
|
|
||||||
SpooledTemporaryFile,
|
|
||||||
_TemporaryFileWrapper,
|
|
||||||
]
|
|
||||||
],
|
|
||||||
name: Optional[str] = ...,
|
|
||||||
) -> None: ...
|
|
||||||
def __bool__(self) -> bool: ...
|
def __bool__(self) -> bool: ...
|
||||||
def __len__(self) -> int: ...
|
def __len__(self) -> int: ...
|
||||||
def size(self) -> int: ...
|
def size(self) -> int: ...
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
from io import BytesIO
|
from io import BytesIO
|
||||||
from typing import Any, Dict, Optional, Tuple, Union
|
from typing import Any, Dict, Optional, Union
|
||||||
|
|
||||||
from django.core.files.uploadedfile import (InMemoryUploadedFile,
|
from django.core.files.uploadedfile import (InMemoryUploadedFile,
|
||||||
TemporaryUploadedFile)
|
TemporaryUploadedFile)
|
||||||
from django.core.handlers.wsgi import WSGIRequest
|
from django.core.handlers.wsgi import WSGIRequest
|
||||||
from django.test.client import FakePayload
|
|
||||||
|
|
||||||
|
|
||||||
class UploadFileException(Exception): ...
|
class UploadFileException(Exception): ...
|
||||||
@@ -28,12 +27,7 @@ class FileUploadHandler:
|
|||||||
def handle_raw_input(
|
def handle_raw_input(
|
||||||
self,
|
self,
|
||||||
input_data: Union[BytesIO, WSGIRequest],
|
input_data: Union[BytesIO, WSGIRequest],
|
||||||
META: Dict[
|
META: Dict[str, Any],
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
Dict[str, str], Tuple[int, int], BytesIO, FakePayload, int, str
|
|
||||||
],
|
|
||||||
],
|
|
||||||
content_length: int,
|
content_length: int,
|
||||||
boundary: bytes,
|
boundary: bytes,
|
||||||
encoding: str = ...,
|
encoding: str = ...,
|
||||||
@@ -75,12 +69,7 @@ class MemoryFileUploadHandler(FileUploadHandler):
|
|||||||
def handle_raw_input(
|
def handle_raw_input(
|
||||||
self,
|
self,
|
||||||
input_data: Union[BytesIO, WSGIRequest],
|
input_data: Union[BytesIO, WSGIRequest],
|
||||||
META: Dict[
|
META: Dict[str, Any],
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
Dict[str, str], Tuple[int, int], BytesIO, FakePayload, int, str
|
|
||||||
],
|
|
||||||
],
|
|
||||||
content_length: int,
|
content_length: int,
|
||||||
boundary: bytes,
|
boundary: bytes,
|
||||||
encoding: str = ...,
|
encoding: str = ...,
|
||||||
|
|||||||
@@ -1,9 +1,7 @@
|
|||||||
from typing import Any, Callable, Optional, Union
|
from typing import Any, Callable, Optional
|
||||||
|
|
||||||
from django.core.exceptions import PermissionDenied, SuspiciousOperation
|
|
||||||
from django.core.handlers.wsgi import WSGIRequest
|
from django.core.handlers.wsgi import WSGIRequest
|
||||||
from django.http.multipartparser import MultiPartParserError
|
from django.http.response import HttpResponse
|
||||||
from django.http.response import Http404, HttpResponse
|
|
||||||
from django.urls.resolvers import URLResolver
|
from django.urls.resolvers import URLResolver
|
||||||
|
|
||||||
|
|
||||||
@@ -15,9 +13,7 @@ def get_exception_response(
|
|||||||
request: WSGIRequest,
|
request: WSGIRequest,
|
||||||
resolver: URLResolver,
|
resolver: URLResolver,
|
||||||
status_code: int,
|
status_code: int,
|
||||||
exception: Union[
|
exception: Exception,
|
||||||
PermissionDenied, SuspiciousOperation, MultiPartParserError, Http404
|
|
||||||
],
|
|
||||||
sender: None = ...,
|
sender: None = ...,
|
||||||
) -> HttpResponse: ...
|
) -> HttpResponse: ...
|
||||||
def handle_uncaught_exception(request: Any, resolver: Any, exc_info: Any): ...
|
def handle_uncaught_exception(request: Any, resolver: Any, exc_info: Any): ...
|
||||||
|
|||||||
@@ -51,28 +51,7 @@ class WSGIRequest(HttpRequest):
|
|||||||
method: str = ...
|
method: str = ...
|
||||||
encoding: Any = ...
|
encoding: Any = ...
|
||||||
resolver_match: None = ...
|
resolver_match: None = ...
|
||||||
def __init__(
|
def __init__(self, environ: Dict[str, Any]) -> None: ...
|
||||||
self,
|
|
||||||
environ: Union[
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Optional[
|
|
||||||
Union[Tuple[int, int], BytesIO, FakePayload, int, str]
|
|
||||||
],
|
|
||||||
],
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
Dict[str, str],
|
|
||||||
Tuple[int, int],
|
|
||||||
BytesIO,
|
|
||||||
FakePayload,
|
|
||||||
int,
|
|
||||||
str,
|
|
||||||
],
|
|
||||||
],
|
|
||||||
],
|
|
||||||
) -> None: ...
|
|
||||||
def GET(self) -> QueryDict: ...
|
def GET(self) -> QueryDict: ...
|
||||||
def COOKIES(self) -> Dict[str, str]: ...
|
def COOKIES(self) -> Dict[str, str]: ...
|
||||||
@property
|
@property
|
||||||
@@ -90,63 +69,11 @@ class WSGIHandler(base.BaseHandler):
|
|||||||
start_response: Callable,
|
start_response: Callable,
|
||||||
) -> HttpResponse: ...
|
) -> HttpResponse: ...
|
||||||
|
|
||||||
def get_path_info(
|
def get_path_info(environ: Dict[str, Any]) -> str: ...
|
||||||
environ: Union[
|
def get_script_name(environ: Dict[str, Any]) -> str: ...
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Optional[Union[Tuple[int, int], BytesIO, FakePayload, int, str]],
|
|
||||||
],
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
Dict[str, str], Tuple[int, int], BytesIO, FakePayload, int, str
|
|
||||||
],
|
|
||||||
],
|
|
||||||
]
|
|
||||||
) -> str: ...
|
|
||||||
def get_script_name(
|
|
||||||
environ: Union[
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Optional[Union[Tuple[int, int], BytesIO, FakePayload, int, str]],
|
|
||||||
],
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
Dict[str, str], Tuple[int, int], BytesIO, FakePayload, int, str
|
|
||||||
],
|
|
||||||
],
|
|
||||||
]
|
|
||||||
) -> str: ...
|
|
||||||
def get_bytes_from_wsgi(
|
def get_bytes_from_wsgi(
|
||||||
environ: Union[
|
environ: Dict[str, Any], key: str, default: str
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Optional[Union[Tuple[int, int], BytesIO, FakePayload, int, str]],
|
|
||||||
],
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
Dict[str, str], Tuple[int, int], BytesIO, FakePayload, int, str
|
|
||||||
],
|
|
||||||
],
|
|
||||||
],
|
|
||||||
key: str,
|
|
||||||
default: str,
|
|
||||||
) -> bytes: ...
|
) -> bytes: ...
|
||||||
def get_str_from_wsgi(
|
def get_str_from_wsgi(
|
||||||
environ: Union[
|
environ: Dict[str, Any], key: str, default: str
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Optional[Union[Tuple[int, int], BytesIO, FakePayload, int, str]],
|
|
||||||
],
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
Dict[str, str], Tuple[int, int], BytesIO, FakePayload, int, str
|
|
||||||
],
|
|
||||||
],
|
|
||||||
],
|
|
||||||
key: str,
|
|
||||||
default: str,
|
|
||||||
) -> str: ...
|
) -> str: ...
|
||||||
|
|||||||
@@ -1,11 +1,8 @@
|
|||||||
from argparse import (ArgumentParser, HelpFormatter, Namespace, _AppendAction,
|
from argparse import ArgumentParser, HelpFormatter, Namespace
|
||||||
_HelpAction, _StoreAction, _StoreFalseAction,
|
|
||||||
_StoreTrueAction, _VersionAction)
|
|
||||||
from io import StringIO, TextIOBase, TextIOWrapper
|
from io import StringIO, TextIOBase, TextIOWrapper
|
||||||
from typing import Any, Callable, List, Optional, Tuple, Union
|
from typing import Any, Callable, List, Optional, Tuple, Union
|
||||||
|
|
||||||
from django.contrib.admin.apps import SimpleAdminConfig
|
from django.apps.config import AppConfig
|
||||||
from django.contrib.auth.apps import AuthConfig
|
|
||||||
|
|
||||||
|
|
||||||
class CommandError(Exception): ...
|
class CommandError(Exception): ...
|
||||||
@@ -37,34 +34,9 @@ def no_translations(handle_func: Callable) -> Callable: ...
|
|||||||
class DjangoHelpFormatter(HelpFormatter):
|
class DjangoHelpFormatter(HelpFormatter):
|
||||||
show_last: Any = ...
|
show_last: Any = ...
|
||||||
def add_usage(
|
def add_usage(
|
||||||
self,
|
self, usage: None, actions: List[Any], *args: Any, **kwargs: Any
|
||||||
usage: None,
|
|
||||||
actions: List[
|
|
||||||
Union[
|
|
||||||
_AppendAction,
|
|
||||||
_HelpAction,
|
|
||||||
_StoreAction,
|
|
||||||
_StoreFalseAction,
|
|
||||||
_StoreTrueAction,
|
|
||||||
_VersionAction,
|
|
||||||
]
|
|
||||||
],
|
|
||||||
*args: Any,
|
|
||||||
**kwargs: Any
|
|
||||||
) -> None: ...
|
|
||||||
def add_arguments(
|
|
||||||
self,
|
|
||||||
actions: List[
|
|
||||||
Union[
|
|
||||||
_AppendAction,
|
|
||||||
_HelpAction,
|
|
||||||
_StoreAction,
|
|
||||||
_StoreFalseAction,
|
|
||||||
_StoreTrueAction,
|
|
||||||
_VersionAction,
|
|
||||||
]
|
|
||||||
],
|
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
|
def add_arguments(self, actions: List[Any]) -> None: ...
|
||||||
|
|
||||||
class OutputWrapper(TextIOBase):
|
class OutputWrapper(TextIOBase):
|
||||||
@property
|
@property
|
||||||
@@ -116,7 +88,7 @@ class BaseCommand:
|
|||||||
) -> Optional[Union[Tuple, str]]: ...
|
) -> Optional[Union[Tuple, str]]: ...
|
||||||
def check(
|
def check(
|
||||||
self,
|
self,
|
||||||
app_configs: Optional[List[Union[SimpleAdminConfig, AuthConfig]]] = ...,
|
app_configs: Optional[List[AppConfig]] = ...,
|
||||||
tags: Optional[List[str]] = ...,
|
tags: Optional[List[str]] = ...,
|
||||||
display_num_errors: bool = ...,
|
display_num_errors: bool = ...,
|
||||||
include_deployment_checks: bool = ...,
|
include_deployment_checks: bool = ...,
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
from collections import OrderedDict
|
from collections import OrderedDict
|
||||||
from io import StringIO
|
from typing import Any, Dict, Iterator, List, Optional, Tuple, Union
|
||||||
from typing import Any, Callable, Dict, Iterator, List, Optional, Tuple, Union
|
|
||||||
|
|
||||||
from django.core.management.base import BaseCommand, CommandParser
|
from django.core.management.base import BaseCommand, CommandParser
|
||||||
from django.db.backends.base.introspection import FieldInfo
|
from django.db.backends.base.introspection import FieldInfo
|
||||||
@@ -17,12 +16,7 @@ class Command(BaseCommand):
|
|||||||
db_module: str = ...
|
db_module: str = ...
|
||||||
def add_arguments(self, parser: CommandParser) -> None: ...
|
def add_arguments(self, parser: CommandParser) -> None: ...
|
||||||
def handle(self, **options: Any) -> None: ...
|
def handle(self, **options: Any) -> None: ...
|
||||||
def handle_inspection(
|
def handle_inspection(self, options: Dict[str, Any]) -> Iterator[str]: ...
|
||||||
self,
|
|
||||||
options: Dict[
|
|
||||||
str, Optional[Union[Callable, List[str], StringIO, int, str]]
|
|
||||||
],
|
|
||||||
) -> Iterator[str]: ...
|
|
||||||
def normalize_col_name(
|
def normalize_col_name(
|
||||||
self, col_name: str, used_column_names: List[str], is_relation: bool
|
self, col_name: str, used_column_names: List[str], is_relation: bool
|
||||||
) -> Tuple[str, Dict[str, str], List[str]]: ...
|
) -> Tuple[str, Dict[str, str], List[str]]: ...
|
||||||
@@ -37,7 +31,6 @@ class Command(BaseCommand):
|
|||||||
Union[
|
Union[
|
||||||
Dict[str, Union[List[str], Tuple[str, str], bool]],
|
Dict[str, Union[List[str], Tuple[str, str], bool]],
|
||||||
Dict[str, Union[List[str], bool, str]],
|
Dict[str, Union[List[str], bool, str]],
|
||||||
Dict[str, Union[List[str], bool]],
|
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
column_to_field_name: Dict[str, str],
|
column_to_field_name: Dict[str, str],
|
||||||
|
|||||||
@@ -24,9 +24,7 @@ class Paginator:
|
|||||||
orphans: int = ...,
|
orphans: int = ...,
|
||||||
allow_empty_first_page: bool = ...,
|
allow_empty_first_page: bool = ...,
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
def validate_number(
|
def validate_number(self, number: Optional[Union[float, str]]) -> int: ...
|
||||||
self, number: Optional[Union[float, int, str]]
|
|
||||||
) -> int: ...
|
|
||||||
def get_page(self, number: Optional[int]) -> Page: ...
|
def get_page(self, number: Optional[int]) -> Page: ...
|
||||||
def page(self, number: Union[int, str]) -> Page: ...
|
def page(self, number: Union[int, str]) -> Page: ...
|
||||||
def count(self) -> int: ...
|
def count(self) -> int: ...
|
||||||
|
|||||||
@@ -1,11 +1,8 @@
|
|||||||
from collections import OrderedDict
|
from collections import OrderedDict
|
||||||
from gzip import GzipFile
|
|
||||||
from io import BufferedReader, StringIO, TextIOWrapper
|
|
||||||
from typing import (Any, Callable, Dict, Iterator, List, Optional, Tuple, Type,
|
from typing import (Any, Callable, Dict, Iterator, List, Optional, Tuple, Type,
|
||||||
Union)
|
Union)
|
||||||
|
|
||||||
from django.apps.config import AppConfig
|
from django.apps.config import AppConfig
|
||||||
from django.core.management.commands.loaddata import SingleZipReader
|
|
||||||
from django.core.serializers.python import Serializer
|
from django.core.serializers.python import Serializer
|
||||||
from django.core.serializers.xml_serializer import Deserializer, Serializer
|
from django.core.serializers.xml_serializer import Deserializer, Serializer
|
||||||
from django.db.models.base import Model
|
from django.db.models.base import Model
|
||||||
@@ -27,7 +24,9 @@ def register_serializer(
|
|||||||
def unregister_serializer(format: str) -> None: ...
|
def unregister_serializer(format: str) -> None: ...
|
||||||
def get_serializer(
|
def get_serializer(
|
||||||
format: str
|
format: str
|
||||||
) -> Union[Type[Union[Serializer, Serializer]], BadSerializer]: ...
|
) -> Union[
|
||||||
|
Type[Union[python.Serializer, xml_serializer.Serializer]], BadSerializer
|
||||||
|
]: ...
|
||||||
def get_serializer_formats() -> List[str]: ...
|
def get_serializer_formats() -> List[str]: ...
|
||||||
def get_public_serializer_formats() -> List[str]: ...
|
def get_public_serializer_formats() -> List[str]: ...
|
||||||
def get_deserializer(format: str) -> Union[Callable, Type[Deserializer]]: ...
|
def get_deserializer(format: str) -> Union[Callable, Type[Deserializer]]: ...
|
||||||
@@ -37,18 +36,10 @@ def serialize(
|
|||||||
**options: Any
|
**options: Any
|
||||||
) -> Optional[Union[List[OrderedDict], bytes, str]]: ...
|
) -> Optional[Union[List[OrderedDict], bytes, str]]: ...
|
||||||
def deserialize(
|
def deserialize(
|
||||||
format: str,
|
format: str, stream_or_string: Any, **options: Any
|
||||||
stream_or_string: Union[
|
|
||||||
List[OrderedDict],
|
|
||||||
BufferedReader,
|
|
||||||
StringIO,
|
|
||||||
TextIOWrapper,
|
|
||||||
SingleZipReader,
|
|
||||||
GzipFile,
|
|
||||||
str,
|
|
||||||
],
|
|
||||||
**options: Any
|
|
||||||
) -> Union[Iterator[Any], Deserializer]: ...
|
) -> Union[Iterator[Any], Deserializer]: ...
|
||||||
def sort_dependencies(
|
def sort_dependencies(
|
||||||
app_list: List[Union[Tuple[AppConfig, None], Tuple[str, List[Type[Model]]]]]
|
app_list: Union[
|
||||||
|
List[Tuple[AppConfig, None]], List[Tuple[str, List[Type[Model]]]]
|
||||||
|
]
|
||||||
) -> List[Type[Model]]: ...
|
) -> List[Type[Model]]: ...
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ from io import BufferedReader, StringIO, TextIOWrapper
|
|||||||
from typing import Any, Dict, Iterator, List, Optional, Tuple, Type, Union
|
from typing import Any, Dict, Iterator, List, Optional, Tuple, Type, Union
|
||||||
from uuid import UUID
|
from uuid import UUID
|
||||||
|
|
||||||
from django.core.exceptions import ObjectDoesNotExist, ValidationError
|
|
||||||
from django.core.management.base import OutputWrapper
|
from django.core.management.base import OutputWrapper
|
||||||
from django.core.serializers.xml_serializer import Deserializer
|
from django.core.serializers.xml_serializer import Deserializer
|
||||||
from django.db.models.base import Model
|
from django.db.models.base import Model
|
||||||
@@ -20,7 +19,7 @@ class DeserializationError(Exception):
|
|||||||
@classmethod
|
@classmethod
|
||||||
def WithData(
|
def WithData(
|
||||||
cls,
|
cls,
|
||||||
original_exc: Union[ObjectDoesNotExist, ValidationError],
|
original_exc: Exception,
|
||||||
model: str,
|
model: str,
|
||||||
fk: Union[int, str],
|
fk: Union[int, str],
|
||||||
field_value: Optional[Union[List[str], str]],
|
field_value: Optional[Union[List[str], str]],
|
||||||
@@ -30,9 +29,7 @@ class M2MDeserializationError(Exception):
|
|||||||
original_exc: django.core.exceptions.ObjectDoesNotExist = ...
|
original_exc: django.core.exceptions.ObjectDoesNotExist = ...
|
||||||
pk: List[str] = ...
|
pk: List[str] = ...
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self, original_exc: Exception, pk: Union[List[str], str]
|
||||||
original_exc: Union[ObjectDoesNotExist, ValidationError],
|
|
||||||
pk: Union[List[str], str],
|
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
|
|
||||||
class ProgressBar:
|
class ProgressBar:
|
||||||
@@ -91,9 +88,7 @@ class DeserializedObject:
|
|||||||
object: django.db.models.base.Model = ...
|
object: django.db.models.base.Model = ...
|
||||||
m2m_data: Dict[Any, Any] = ...
|
m2m_data: Dict[Any, Any] = ...
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self, obj: Model, m2m_data: Optional[Dict[str, List[int]]] = ...
|
||||||
obj: Model,
|
|
||||||
m2m_data: Optional[Dict[str, Union[List[Any], List[int]]]] = ...,
|
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
def save(
|
def save(
|
||||||
self, save_m2m: bool = ..., using: Optional[str] = ..., **kwargs: Any
|
self, save_m2m: bool = ..., using: Optional[str] = ..., **kwargs: Any
|
||||||
@@ -109,7 +104,7 @@ def build_instance(
|
|||||||
Dict[str, Union[date, int, str]],
|
Dict[str, Union[date, int, str]],
|
||||||
Dict[str, Union[time, int]],
|
Dict[str, Union[time, int]],
|
||||||
Dict[str, Union[Decimal, int, str]],
|
Dict[str, Union[Decimal, int, str]],
|
||||||
Dict[str, Union[float, int, str]],
|
Dict[str, Union[float, str]],
|
||||||
Dict[str, Union[int, memoryview]],
|
Dict[str, Union[int, memoryview]],
|
||||||
Dict[str, Union[int, UUID]],
|
Dict[str, Union[int, UUID]],
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -1,12 +1,9 @@
|
|||||||
import json
|
import json
|
||||||
from datetime import date, time, timedelta
|
from datetime import date, time, timedelta
|
||||||
from decimal import Decimal
|
from decimal import Decimal
|
||||||
from gzip import GzipFile
|
|
||||||
from io import BufferedReader, StringIO, TextIOWrapper
|
|
||||||
from typing import Any, Optional, Union
|
from typing import Any, Optional, Union
|
||||||
from uuid import UUID
|
from uuid import UUID
|
||||||
|
|
||||||
from django.core.management.commands.loaddata import SingleZipReader
|
|
||||||
from django.core.serializers.python import Serializer as PythonSerializer
|
from django.core.serializers.python import Serializer as PythonSerializer
|
||||||
from django.db.models.base import Model
|
from django.db.models.base import Model
|
||||||
|
|
||||||
@@ -26,12 +23,7 @@ class Serializer(PythonSerializer):
|
|||||||
def end_object(self, obj: Model) -> None: ...
|
def end_object(self, obj: Model) -> None: ...
|
||||||
def getvalue(self) -> Optional[Union[bytes, str]]: ...
|
def getvalue(self) -> Optional[Union[bytes, str]]: ...
|
||||||
|
|
||||||
def Deserializer(
|
def Deserializer(stream_or_string: Any, **options: Any) -> None: ...
|
||||||
stream_or_string: Union[
|
|
||||||
BufferedReader, StringIO, TextIOWrapper, SingleZipReader, GzipFile, str
|
|
||||||
],
|
|
||||||
**options: Any
|
|
||||||
) -> None: ...
|
|
||||||
|
|
||||||
class DjangoJSONEncoder(json.JSONEncoder):
|
class DjangoJSONEncoder(json.JSONEncoder):
|
||||||
allow_nan: bool
|
allow_nan: bool
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
from collections import OrderedDict
|
from collections import OrderedDict
|
||||||
from datetime import date, datetime
|
from datetime import date
|
||||||
from typing import Any, Dict, Iterator, List, Optional, Union
|
from typing import Any, Dict, Iterator, List, Optional, Union
|
||||||
|
|
||||||
from django.core.serializers import base
|
from django.core.serializers import base
|
||||||
@@ -29,16 +29,28 @@ class Serializer(base.Serializer):
|
|||||||
|
|
||||||
def Deserializer(
|
def Deserializer(
|
||||||
object_list: Union[
|
object_list: Union[
|
||||||
|
List[Dict[str, Optional[Union[Dict[str, None], str]]]],
|
||||||
|
List[Dict[str, Optional[Union[Dict[str, Union[float, str]], str]]]],
|
||||||
|
List[
|
||||||
|
Dict[
|
||||||
|
str,
|
||||||
|
Union[Dict[str, Union[List[List[str]], int, str]], int, str],
|
||||||
|
]
|
||||||
|
],
|
||||||
List[
|
List[
|
||||||
Dict[
|
Dict[
|
||||||
str,
|
str,
|
||||||
Union[
|
Union[
|
||||||
Dict[str, Union[List[Any], List[int], datetime, int, str]],
|
Dict[str, Union[List[Union[int, str]], int, str]], int, str
|
||||||
int,
|
|
||||||
str,
|
|
||||||
],
|
],
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
|
List[
|
||||||
|
Dict[
|
||||||
|
str,
|
||||||
|
Union[Dict[str, Union[List[int], date, int, str]], int, str],
|
||||||
|
]
|
||||||
|
],
|
||||||
List[
|
List[
|
||||||
Union[
|
Union[
|
||||||
Dict[str, Optional[Union[Dict[str, Optional[str]], str]]],
|
Dict[str, Optional[Union[Dict[str, Optional[str]], str]]],
|
||||||
@@ -50,147 +62,42 @@ def Deserializer(
|
|||||||
str,
|
str,
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
Dict[str, Union[Dict[str, str], int, str]],
|
|
||||||
]
|
|
||||||
],
|
|
||||||
List[
|
|
||||||
Union[
|
|
||||||
Dict[
|
|
||||||
str, Optional[Union[Dict[str, Union[float, int, str]], str]]
|
|
||||||
],
|
|
||||||
Dict[str, Optional[Union[Dict[str, str], str]]],
|
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
List[
|
List[
|
||||||
Union[
|
Union[
|
||||||
Dict[str, Union[Dict[Any, Any], date, str]],
|
Dict[str, Union[Dict[Any, Any], date, str]],
|
||||||
Dict[str, Union[Dict[Any, Any], float, str]],
|
Dict[str, Union[Dict[Any, Any], float, str]],
|
||||||
Dict[str, Union[Dict[Any, Any], int, str]],
|
|
||||||
Dict[str, Union[Dict[str, List[Any]], int, str]],
|
|
||||||
Dict[str, Union[Dict[str, List[int]], int, str]],
|
Dict[str, Union[Dict[str, List[int]], int, str]],
|
||||||
Dict[str, Union[Dict[str, None], int, str]],
|
Dict[str, Union[Dict[str, None], int, str]],
|
||||||
Dict[str, Union[Dict[str, Union[List[Any], List[str]]], str]],
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[Dict[str, Union[List[List[str]], List[str]]], str],
|
|
||||||
],
|
|
||||||
Dict[str, Union[Dict[str, Union[int, str]], int, str]],
|
Dict[str, Union[Dict[str, Union[int, str]], int, str]],
|
||||||
Dict[str, Union[Dict[str, bool], int, str]],
|
|
||||||
Dict[str, Union[Dict[str, date], int, str]],
|
Dict[str, Union[Dict[str, date], int, str]],
|
||||||
Dict[str, Union[Dict[str, datetime], int, str]],
|
|
||||||
Dict[str, Union[Dict[str, float], int, str]],
|
Dict[str, Union[Dict[str, float], int, str]],
|
||||||
Dict[str, Union[Dict[str, int], int, str]],
|
|
||||||
Dict[str, Union[Dict[str, str], int, str]],
|
|
||||||
]
|
|
||||||
],
|
|
||||||
List[
|
|
||||||
Union[
|
|
||||||
Dict[str, Union[Dict[str, List[Any]], int, str]],
|
|
||||||
Dict[str, Union[Dict[str, Union[List[Any], str]], int, str]],
|
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
List[
|
List[
|
||||||
Union[
|
Union[
|
||||||
Dict[str, Union[Dict[str, List[str]], int, str]],
|
Dict[str, Union[Dict[str, List[str]], int, str]],
|
||||||
Dict[str, Union[Dict[str, None], int, str]],
|
|
||||||
Dict[str, Union[Dict[str, Optional[str]], int, str]],
|
Dict[str, Union[Dict[str, Optional[str]], int, str]],
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
List[
|
List[
|
||||||
Union[
|
Union[
|
||||||
|
Dict[str, Union[Dict[str, Union[List[Any], str]], int, str]],
|
||||||
Dict[
|
Dict[
|
||||||
str,
|
str,
|
||||||
Union[
|
Union[
|
||||||
Dict[str, Union[List[Any], List[List[str]], bool, str]],
|
Dict[str, Union[List[List[str]], bool, str]], int, str
|
||||||
int,
|
|
||||||
str,
|
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
Dict[str, Union[Dict[str, Union[List[Any], str]], int, str]],
|
|
||||||
]
|
|
||||||
],
|
|
||||||
List[
|
|
||||||
Union[
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
Dict[str, Union[List[Any], List[int], bool, str]],
|
|
||||||
int,
|
|
||||||
str,
|
|
||||||
],
|
|
||||||
],
|
|
||||||
Dict[str, Union[Dict[str, Union[List[Any], str]], int, str]],
|
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
List[
|
List[
|
||||||
Union[
|
Union[
|
||||||
Dict[str, Union[Dict[str, Union[List[Any], str]], int, str]],
|
Dict[str, Union[Dict[str, Union[List[Any], str]], int, str]],
|
||||||
Dict[str, Union[Dict[str, str], int, str]],
|
|
||||||
]
|
|
||||||
],
|
|
||||||
List[
|
|
||||||
Union[
|
|
||||||
Dict[
|
Dict[
|
||||||
str,
|
str, Union[Dict[str, Union[List[int], bool, str]], int, str]
|
||||||
Union[
|
|
||||||
Dict[str, Union[List[List[str]], int, str]], int, str
|
|
||||||
],
|
|
||||||
],
|
],
|
||||||
Dict[str, Union[Dict[str, str], int, str]],
|
|
||||||
]
|
|
||||||
],
|
|
||||||
List[
|
|
||||||
Union[
|
|
||||||
Dict[
|
|
||||||
str, Union[Dict[str, Union[List[List[str]], str]], int, str]
|
|
||||||
],
|
|
||||||
Dict[str, Union[Dict[str, str], int, str]],
|
|
||||||
]
|
|
||||||
],
|
|
||||||
List[
|
|
||||||
Union[
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
Dict[str, Union[List[Union[int, str]], int, str]],
|
|
||||||
int,
|
|
||||||
str,
|
|
||||||
],
|
|
||||||
],
|
|
||||||
Dict[str, Union[Dict[str, str], int, str]],
|
|
||||||
]
|
|
||||||
],
|
|
||||||
List[
|
|
||||||
Union[
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
Dict[str, Union[List[int], datetime, int, str]],
|
|
||||||
int,
|
|
||||||
str,
|
|
||||||
],
|
|
||||||
],
|
|
||||||
Dict[str, Union[Dict[str, str], int, str]],
|
|
||||||
]
|
|
||||||
],
|
|
||||||
List[
|
|
||||||
Union[
|
|
||||||
Dict[
|
|
||||||
str, Union[Dict[str, Union[List[int], int, str]], int, str]
|
|
||||||
],
|
|
||||||
Dict[str, Union[Dict[str, str], int, str]],
|
|
||||||
]
|
|
||||||
],
|
|
||||||
List[
|
|
||||||
Union[
|
|
||||||
Dict[str, Union[Dict[str, Union[List[int], str]], int, str]],
|
|
||||||
Dict[str, Union[Dict[str, str], int, str]],
|
|
||||||
]
|
|
||||||
],
|
|
||||||
List[
|
|
||||||
Union[
|
|
||||||
Dict[str, Union[Dict[str, Union[List[str], str]], int, str]],
|
|
||||||
Dict[str, Union[Dict[str, str], str]],
|
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ class RegexValidator:
|
|||||||
inverse_match: Optional[bool] = ...,
|
inverse_match: Optional[bool] = ...,
|
||||||
flags: Optional[RegexFlag] = ...,
|
flags: Optional[RegexFlag] = ...,
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
def __call__(self, value: Optional[Union[float, int, str]]) -> None: ...
|
def __call__(self, value: Optional[Union[float, str]]) -> None: ...
|
||||||
def __eq__(
|
def __eq__(
|
||||||
self, other: Union[ProhibitNullCharactersValidator, RegexValidator]
|
self, other: Union[ProhibitNullCharactersValidator, RegexValidator]
|
||||||
) -> bool: ...
|
) -> bool: ...
|
||||||
@@ -45,7 +45,7 @@ class URLValidator(RegexValidator):
|
|||||||
|
|
||||||
integer_validator: Any
|
integer_validator: Any
|
||||||
|
|
||||||
def validate_integer(value: Optional[Union[float, int, str]]) -> None: ...
|
def validate_integer(value: Optional[Union[float, str]]) -> None: ...
|
||||||
|
|
||||||
class EmailValidator:
|
class EmailValidator:
|
||||||
message: Any = ...
|
message: Any = ...
|
||||||
@@ -92,17 +92,17 @@ class BaseValidator:
|
|||||||
limit_value: bool = ...
|
limit_value: bool = ...
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
limit_value: Optional[Union[datetime, Decimal, float, int, str]],
|
limit_value: Optional[Union[datetime, Decimal, float, str]],
|
||||||
message: Optional[str] = ...,
|
message: Optional[str] = ...,
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
def __call__(
|
def __call__(
|
||||||
self, value: Union[bytes, datetime, Decimal, float, int, str]
|
self, value: Union[bytes, datetime, Decimal, float, str]
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
def __eq__(self, other: BaseValidator) -> bool: ...
|
def __eq__(self, other: BaseValidator) -> bool: ...
|
||||||
def compare(self, a: bool, b: bool) -> bool: ...
|
def compare(self, a: bool, b: bool) -> bool: ...
|
||||||
def clean(
|
def clean(
|
||||||
self, x: Union[datetime, Decimal, float, int]
|
self, x: Union[datetime, Decimal, float]
|
||||||
) -> Union[datetime, Decimal, float, int]: ...
|
) -> Union[datetime, Decimal, float]: ...
|
||||||
|
|
||||||
class MaxValueValidator(BaseValidator):
|
class MaxValueValidator(BaseValidator):
|
||||||
limit_value: decimal.Decimal
|
limit_value: decimal.Decimal
|
||||||
@@ -110,8 +110,8 @@ class MaxValueValidator(BaseValidator):
|
|||||||
code: str = ...
|
code: str = ...
|
||||||
def compare(
|
def compare(
|
||||||
self,
|
self,
|
||||||
a: Union[datetime, Decimal, float, int],
|
a: Union[datetime, Decimal, float],
|
||||||
b: Union[datetime, Decimal, float, int],
|
b: Union[datetime, Decimal, float],
|
||||||
) -> bool: ...
|
) -> bool: ...
|
||||||
|
|
||||||
class MinValueValidator(BaseValidator):
|
class MinValueValidator(BaseValidator):
|
||||||
@@ -120,8 +120,8 @@ class MinValueValidator(BaseValidator):
|
|||||||
code: str = ...
|
code: str = ...
|
||||||
def compare(
|
def compare(
|
||||||
self,
|
self,
|
||||||
a: Union[datetime, Decimal, float, int],
|
a: Union[datetime, Decimal, float],
|
||||||
b: Union[datetime, Decimal, float, int],
|
b: Union[datetime, Decimal, float],
|
||||||
) -> bool: ...
|
) -> bool: ...
|
||||||
|
|
||||||
class MinLengthValidator(BaseValidator):
|
class MinLengthValidator(BaseValidator):
|
||||||
|
|||||||
@@ -1,12 +1,7 @@
|
|||||||
from collections import deque
|
from typing import Any, Optional, Union
|
||||||
from typing import Any, Callable, Dict, List, Optional, Union
|
|
||||||
from unittest.mock import MagicMock
|
from unittest.mock import MagicMock
|
||||||
|
|
||||||
from django.db.backends.sqlite3.base import DatabaseWrapper
|
from django.db.backends.sqlite3.base import DatabaseWrapper
|
||||||
from django.db.backends.sqlite3.creation import DatabaseCreation
|
|
||||||
from django.db.backends.sqlite3.features import DatabaseFeatures
|
|
||||||
from django.db.backends.sqlite3.introspection import DatabaseIntrospection
|
|
||||||
from django.db.backends.sqlite3.operations import DatabaseOperations
|
|
||||||
from django.db.utils import DEFAULT_DB_ALIAS as DEFAULT_DB_ALIAS
|
from django.db.utils import DEFAULT_DB_ALIAS as DEFAULT_DB_ALIAS
|
||||||
from django.db.utils import \
|
from django.db.utils import \
|
||||||
DJANGO_VERSION_PICKLE_KEY as DJANGO_VERSION_PICKLE_KEY
|
DJANGO_VERSION_PICKLE_KEY as DJANGO_VERSION_PICKLE_KEY
|
||||||
@@ -24,21 +19,7 @@ connections: Any
|
|||||||
router: Any
|
router: Any
|
||||||
|
|
||||||
class DefaultConnectionProxy:
|
class DefaultConnectionProxy:
|
||||||
def __getattr__(
|
def __getattr__(self, item: str) -> Any: ...
|
||||||
self, item: str
|
|
||||||
) -> Union[
|
|
||||||
Callable,
|
|
||||||
Dict[str, Optional[Union[Dict[Any, Any], Dict[str, None], int, str]]],
|
|
||||||
List[Dict[str, str]],
|
|
||||||
List[str],
|
|
||||||
bool,
|
|
||||||
deque,
|
|
||||||
DatabaseCreation,
|
|
||||||
DatabaseFeatures,
|
|
||||||
DatabaseIntrospection,
|
|
||||||
DatabaseOperations,
|
|
||||||
str,
|
|
||||||
]: ...
|
|
||||||
def __setattr__(self, name: str, value: Union[bool, MagicMock]) -> None: ...
|
def __setattr__(self, name: str, value: Union[bool, MagicMock]) -> None: ...
|
||||||
def __delattr__(self, name: str) -> None: ...
|
def __delattr__(self, name: str) -> None: ...
|
||||||
def __eq__(self, other: DatabaseWrapper) -> bool: ...
|
def __eq__(self, other: DatabaseWrapper) -> bool: ...
|
||||||
|
|||||||
@@ -27,7 +27,10 @@ class BaseDatabaseOperations:
|
|||||||
explain_prefix: Any = ...
|
explain_prefix: Any = ...
|
||||||
connection: django.db.DefaultConnectionProxy = ...
|
connection: django.db.DefaultConnectionProxy = ...
|
||||||
def __init__(
|
def __init__(
|
||||||
self, connection: Union[DefaultConnectionProxy, BaseDatabaseWrapper]
|
self,
|
||||||
|
connection: Union[
|
||||||
|
DefaultConnectionProxy, backends.base.base.BaseDatabaseWrapper
|
||||||
|
],
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
def autoinc_sql(self, table: str, column: str) -> None: ...
|
def autoinc_sql(self, table: str, column: str) -> None: ...
|
||||||
def bulk_batch_size(self, fields: Any, objs: Any): ...
|
def bulk_batch_size(self, fields: Any, objs: Any): ...
|
||||||
@@ -131,7 +134,7 @@ class BaseDatabaseOperations:
|
|||||||
def get_db_converters(self, expression: Expression) -> List[Any]: ...
|
def get_db_converters(self, expression: Expression) -> List[Any]: ...
|
||||||
def convert_durationfield_value(
|
def convert_durationfield_value(
|
||||||
self,
|
self,
|
||||||
value: Optional[Union[float, int]],
|
value: Optional[float],
|
||||||
expression: Expression,
|
expression: Expression,
|
||||||
connection: DatabaseWrapper,
|
connection: DatabaseWrapper,
|
||||||
) -> Optional[timedelta]: ...
|
) -> Optional[timedelta]: ...
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ class SQLiteCursorWrapper(Database.Cursor):
|
|||||||
query: str,
|
query: str,
|
||||||
params: Optional[
|
params: Optional[
|
||||||
Union[
|
Union[
|
||||||
List[Optional[Union[float, int, str]]],
|
List[Optional[Union[float, str]]],
|
||||||
List[Optional[Union[int, memoryview, str]]],
|
List[Optional[Union[int, memoryview, str]]],
|
||||||
List[datetime],
|
List[datetime],
|
||||||
Tuple,
|
Tuple,
|
||||||
|
|||||||
@@ -44,6 +44,5 @@ class DatabaseIntrospection(BaseDatabaseIntrospection):
|
|||||||
Union[
|
Union[
|
||||||
Dict[str, Union[List[str], Tuple[str, str], bool]],
|
Dict[str, Union[List[str], Tuple[str, str], bool]],
|
||||||
Dict[str, Union[List[str], bool, str]],
|
Dict[str, Union[List[str], bool, str]],
|
||||||
Dict[str, Union[List[str], bool]],
|
|
||||||
],
|
],
|
||||||
]: ...
|
]: ...
|
||||||
|
|||||||
@@ -8,7 +8,8 @@ from django.db.backends.sqlite3.base import (DatabaseWrapper,
|
|||||||
SQLiteCursorWrapper)
|
SQLiteCursorWrapper)
|
||||||
from django.db.backends.utils import CursorDebugWrapper
|
from django.db.backends.utils import CursorDebugWrapper
|
||||||
from django.db.models.base import Model
|
from django.db.models.base import Model
|
||||||
from django.db.models.expressions import BaseExpression, Col, Expression, F
|
from django.db.models.expressions import (BaseExpression, Col, Expression, F,
|
||||||
|
SQLiteNumericMixin)
|
||||||
from django.db.models.fields import Field
|
from django.db.models.fields import Field
|
||||||
from django.utils.datastructures import ImmutableList
|
from django.utils.datastructures import ImmutableList
|
||||||
|
|
||||||
@@ -85,7 +86,7 @@ class DatabaseOperations(BaseDatabaseOperations):
|
|||||||
connection: DatabaseWrapper,
|
connection: DatabaseWrapper,
|
||||||
) -> Optional[time]: ...
|
) -> Optional[time]: ...
|
||||||
def get_decimalfield_converter(
|
def get_decimalfield_converter(
|
||||||
self, expression: Expression
|
self, expression: Union[Col, SQLiteNumericMixin]
|
||||||
) -> Callable: ...
|
) -> Callable: ...
|
||||||
def convert_uuidfield_value(
|
def convert_uuidfield_value(
|
||||||
self, value: Optional[str], expression: Col, connection: DatabaseWrapper
|
self, value: Optional[str], expression: Col, connection: DatabaseWrapper
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ class CursorWrapper:
|
|||||||
sql: str,
|
sql: str,
|
||||||
params: Optional[
|
params: Optional[
|
||||||
Union[
|
Union[
|
||||||
List[Optional[Union[float, int, str]]],
|
List[Optional[Union[float, str]]],
|
||||||
List[Optional[Union[int, memoryview, str]]],
|
List[Optional[Union[int, memoryview, str]]],
|
||||||
List[datetime],
|
List[datetime],
|
||||||
Tuple,
|
Tuple,
|
||||||
|
|||||||
@@ -1,13 +1,11 @@
|
|||||||
from typing import Any, Callable, Dict, List, Optional, Set, Tuple, Type, Union
|
from typing import Any, Callable, Dict, List, Optional, Set, Tuple, Union
|
||||||
|
|
||||||
from django.core.validators import RegexValidator
|
|
||||||
from django.db.migrations.graph import MigrationGraph
|
from django.db.migrations.graph import MigrationGraph
|
||||||
from django.db.migrations.migration import Migration
|
from django.db.migrations.migration import Migration
|
||||||
from django.db.migrations.operations.base import Operation
|
from django.db.migrations.operations.base import Operation
|
||||||
from django.db.migrations.questioner import MigrationQuestioner
|
from django.db.migrations.questioner import MigrationQuestioner
|
||||||
from django.db.migrations.state import ProjectState
|
from django.db.migrations.state import ProjectState
|
||||||
from django.db.migrations.utils import RegexObject
|
from django.db.models.fields import Field
|
||||||
from django.db.models.fields import Field, IntegerField
|
|
||||||
|
|
||||||
from .topological_sort import stable_topological_sort
|
from .topological_sort import stable_topological_sort
|
||||||
|
|
||||||
@@ -30,46 +28,7 @@ class MigrationAutodetector:
|
|||||||
convert_apps: Optional[Set[str]] = ...,
|
convert_apps: Optional[Set[str]] = ...,
|
||||||
migration_name: Optional[str] = ...,
|
migration_name: Optional[str] = ...,
|
||||||
) -> Dict[str, List[Migration]]: ...
|
) -> Dict[str, List[Migration]]: ...
|
||||||
def deep_deconstruct(
|
def deep_deconstruct(self, obj: Any) -> Any: ...
|
||||||
self,
|
|
||||||
obj: Optional[
|
|
||||||
Union[
|
|
||||||
Callable,
|
|
||||||
Dict[str, int],
|
|
||||||
Dict[str, str],
|
|
||||||
List[RegexValidator],
|
|
||||||
List[int],
|
|
||||||
Tuple[str],
|
|
||||||
Type[IntegerField],
|
|
||||||
Field,
|
|
||||||
int,
|
|
||||||
str,
|
|
||||||
]
|
|
||||||
],
|
|
||||||
) -> Optional[
|
|
||||||
Union[
|
|
||||||
Callable,
|
|
||||||
Dict[str, Union[Tuple[str, List[Any], Dict[Any, Any]], int]],
|
|
||||||
Dict[str, str],
|
|
||||||
List[
|
|
||||||
Union[
|
|
||||||
Tuple[str, List[Union[RegexObject, str]], Dict[Any, Any]],
|
|
||||||
int,
|
|
||||||
]
|
|
||||||
],
|
|
||||||
Tuple[Callable, Tuple[str], Dict[Any, Any]],
|
|
||||||
Tuple[Tuple[str, List[Any], Dict[Any, Any]], int],
|
|
||||||
Tuple[
|
|
||||||
Tuple[str, List[str], Dict[Any, Any]],
|
|
||||||
Tuple[str, List[str], Dict[Any, Any]],
|
|
||||||
],
|
|
||||||
Tuple[str],
|
|
||||||
Type[IntegerField],
|
|
||||||
RegexObject,
|
|
||||||
int,
|
|
||||||
str,
|
|
||||||
]
|
|
||||||
]: ...
|
|
||||||
def only_relation_agnostic_fields(
|
def only_relation_agnostic_fields(
|
||||||
self, fields: List[Tuple[str, Field]]
|
self, fields: List[Tuple[str, Field]]
|
||||||
) -> List[
|
) -> List[
|
||||||
@@ -77,7 +36,6 @@ class MigrationAutodetector:
|
|||||||
str,
|
str,
|
||||||
List[Any],
|
List[Any],
|
||||||
Union[
|
Union[
|
||||||
Dict[Any, Any],
|
|
||||||
Dict[str, Callable],
|
Dict[str, Callable],
|
||||||
Dict[str, Union[Callable, bool]],
|
Dict[str, Union[Callable, bool]],
|
||||||
Dict[str, Union[bool, str]],
|
Dict[str, Union[bool, str]],
|
||||||
|
|||||||
@@ -1,59 +1,55 @@
|
|||||||
from typing import Callable, List, Optional, Set, Tuple, Union
|
from typing import Any, Callable, List, Optional, Set, Tuple, Union
|
||||||
|
|
||||||
from django.contrib.admin.migrations.0001_initial import Migration
|
|
||||||
from django.contrib.admin.migrations.0002_logentry_remove_auto_add import \
|
|
||||||
Migration
|
|
||||||
from django.contrib.admin.migrations.0003_logentry_add_action_flag_choices import \
|
|
||||||
Migration
|
|
||||||
from django.contrib.sites.migrations.0001_initial import Migration
|
|
||||||
from django.contrib.sites.migrations.0002_alter_domain_unique import Migration
|
|
||||||
from django.db import DefaultConnectionProxy
|
from django.db import DefaultConnectionProxy
|
||||||
from django.db.backends.base.base import BaseDatabaseWrapper
|
from django.db.backends.base.base import BaseDatabaseWrapper
|
||||||
from django.db.migrations.migration import Migration
|
from django.db.migrations.migration import Migration
|
||||||
from django.db.migrations.state import ProjectState
|
from django.db.migrations.state import ProjectState
|
||||||
|
|
||||||
|
from .exceptions import InvalidMigrationPlan
|
||||||
|
from .loader import MigrationLoader
|
||||||
|
from .recorder import MigrationRecorder
|
||||||
|
from .state import ProjectState
|
||||||
|
|
||||||
|
|
||||||
class MigrationExecutor:
|
class MigrationExecutor:
|
||||||
connection: django.db.backends.sqlite3.base.DatabaseWrapper
|
connection: django.db.backends.sqlite3.base.DatabaseWrapper = ...
|
||||||
loader: django.db.migrations.loader.MigrationLoader
|
loader: django.db.migrations.loader.MigrationLoader = ...
|
||||||
progress_callback: Callable
|
recorder: django.db.migrations.recorder.MigrationRecorder = ...
|
||||||
recorder: django.db.migrations.recorder.MigrationRecorder
|
progress_callback: Callable = ...
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
connection: Optional[Union[DefaultConnectionProxy, BaseDatabaseWrapper]],
|
connection: Optional[
|
||||||
progress_callback: Optional[Callable] = ...
|
Union[
|
||||||
|
DefaultConnectionProxy, backends.base.base.BaseDatabaseWrapper
|
||||||
|
]
|
||||||
|
],
|
||||||
|
progress_callback: Optional[Callable] = ...,
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
|
def migration_plan(
|
||||||
|
self,
|
||||||
|
targets: Union[List[Tuple[str, Optional[str]]], Set[Tuple[str, str]]],
|
||||||
|
clean_start: bool = ...,
|
||||||
|
) -> List[Tuple[bool, bool]]: ...
|
||||||
|
def migrate(
|
||||||
|
self,
|
||||||
|
targets: Optional[List[Tuple[str, Optional[str]]]],
|
||||||
|
plan: Optional[List[Tuple[Migration, bool]]] = ...,
|
||||||
|
state: Optional[ProjectState] = ...,
|
||||||
|
fake: bool = ...,
|
||||||
|
fake_initial: bool = ...,
|
||||||
|
) -> ProjectState: ...
|
||||||
|
def collect_sql(self, plan: List[Tuple[Migration, bool]]) -> List[str]: ...
|
||||||
def apply_migration(
|
def apply_migration(
|
||||||
self,
|
self,
|
||||||
state: ProjectState,
|
state: ProjectState,
|
||||||
migration: Migration,
|
migration: Migration,
|
||||||
fake: bool = ...,
|
fake: bool = ...,
|
||||||
fake_initial: bool = ...
|
fake_initial: bool = ...,
|
||||||
|
) -> ProjectState: ...
|
||||||
|
def unapply_migration(
|
||||||
|
self, state: ProjectState, migration: Migration, fake: bool = ...
|
||||||
) -> ProjectState: ...
|
) -> ProjectState: ...
|
||||||
def check_replacements(self) -> None: ...
|
def check_replacements(self) -> None: ...
|
||||||
def collect_sql(self, plan: List[Tuple[Migration, bool]]) -> List[str]: ...
|
|
||||||
def detect_soft_applied(
|
def detect_soft_applied(
|
||||||
self,
|
self, project_state: Optional[ProjectState], migration: Migration
|
||||||
project_state: Optional[ProjectState],
|
|
||||||
migration: Migration
|
|
||||||
) -> Tuple[bool, ProjectState]: ...
|
) -> Tuple[bool, ProjectState]: ...
|
||||||
def migrate(
|
|
||||||
self,
|
|
||||||
targets: Optional[List[Tuple[str, Optional[str]]]],
|
|
||||||
plan: Optional[List[Union[Tuple[Migration, bool], Tuple[Migration, bool], Tuple[Migration, bool], Tuple[Migration, bool], Tuple[Migration, bool], Tuple[Migration, bool]]]] = ...,
|
|
||||||
state: Optional[ProjectState] = ...,
|
|
||||||
fake: bool = ...,
|
|
||||||
fake_initial: bool = ...
|
|
||||||
) -> ProjectState: ...
|
|
||||||
def migration_plan(
|
|
||||||
self,
|
|
||||||
targets: Union[List[Tuple[str, Optional[str]]], Set[Tuple[str, str]]],
|
|
||||||
clean_start: bool = ...
|
|
||||||
) -> List[Tuple[bool, bool]]: ...
|
|
||||||
def unapply_migration(
|
|
||||||
self,
|
|
||||||
state: ProjectState,
|
|
||||||
migration: Migration,
|
|
||||||
fake: bool = ...
|
|
||||||
) -> ProjectState: ...
|
|
||||||
|
|||||||
@@ -21,7 +21,9 @@ class MigrationLoader:
|
|||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
connection: Optional[
|
connection: Optional[
|
||||||
Union[DefaultConnectionProxy, BaseDatabaseWrapper]
|
Union[
|
||||||
|
DefaultConnectionProxy, backends.base.base.BaseDatabaseWrapper
|
||||||
|
]
|
||||||
],
|
],
|
||||||
load: bool = ...,
|
load: bool = ...,
|
||||||
ignore_no_migrations: bool = ...,
|
ignore_no_migrations: bool = ...,
|
||||||
|
|||||||
@@ -1,18 +1,4 @@
|
|||||||
from typing import Any, List, Optional, Type, Union
|
from typing import Any, List, Optional, Type
|
||||||
|
|
||||||
from django.contrib.postgres.operations import CreateExtension
|
|
||||||
from django.db.migrations.operations.fields import (AddField, AlterField,
|
|
||||||
RemoveField, RenameField)
|
|
||||||
from django.db.migrations.operations.models import (AddIndex,
|
|
||||||
AlterIndexTogether,
|
|
||||||
AlterModelOptions,
|
|
||||||
AlterModelTable,
|
|
||||||
AlterOrderWithRespectTo,
|
|
||||||
AlterUniqueTogether,
|
|
||||||
CreateModel, DeleteModel,
|
|
||||||
RenameModel)
|
|
||||||
from django.db.migrations.operations.special import (RunPython,
|
|
||||||
SeparateDatabaseAndState)
|
|
||||||
|
|
||||||
|
|
||||||
class Operation:
|
class Operation:
|
||||||
@@ -21,30 +7,7 @@ class Operation:
|
|||||||
atomic: bool = ...
|
atomic: bool = ...
|
||||||
elidable: bool = ...
|
elidable: bool = ...
|
||||||
serialization_expand_args: Any = ...
|
serialization_expand_args: Any = ...
|
||||||
def __new__(
|
def __new__(cls: Type[Any], *args: Any, **kwargs: Any) -> Operation: ...
|
||||||
cls: Type[
|
|
||||||
Union[
|
|
||||||
CreateExtension,
|
|
||||||
AddField,
|
|
||||||
AlterField,
|
|
||||||
RemoveField,
|
|
||||||
RenameField,
|
|
||||||
AddIndex,
|
|
||||||
AlterIndexTogether,
|
|
||||||
AlterModelOptions,
|
|
||||||
AlterModelTable,
|
|
||||||
AlterOrderWithRespectTo,
|
|
||||||
AlterUniqueTogether,
|
|
||||||
CreateModel,
|
|
||||||
DeleteModel,
|
|
||||||
RenameModel,
|
|
||||||
RunPython,
|
|
||||||
SeparateDatabaseAndState,
|
|
||||||
]
|
|
||||||
],
|
|
||||||
*args: Any,
|
|
||||||
**kwargs: Any
|
|
||||||
) -> Operation: ...
|
|
||||||
def deconstruct(self): ...
|
def deconstruct(self): ...
|
||||||
def state_forwards(self, app_label: Any, state: Any) -> None: ...
|
def state_forwards(self, app_label: Any, state: Any) -> None: ...
|
||||||
def database_forwards(
|
def database_forwards(
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
from typing import Any, Dict, List, Optional, Set, Tuple, Type, Union
|
from typing import Any, Dict, List, Optional, Set, Tuple, Type, Union
|
||||||
|
|
||||||
|
from django.contrib.postgres.fields.citext import CIText
|
||||||
from django.db.backends.sqlite3.schema import DatabaseSchemaEditor
|
from django.db.backends.sqlite3.schema import DatabaseSchemaEditor
|
||||||
from django.db.migrations.operations.base import Operation
|
from django.db.migrations.operations.base import Operation
|
||||||
from django.db.migrations.state import ProjectState
|
from django.db.migrations.state import ProjectState
|
||||||
from django.db.models.base import Model
|
from django.db.models.base import Model
|
||||||
from django.db.models.fields import (AutoField, BooleanField, CharField, Field,
|
from django.db.models.fields import Field
|
||||||
IntegerField, SlugField)
|
|
||||||
from django.db.models.indexes import Index
|
from django.db.models.indexes import Index
|
||||||
from django.db.models.manager import Manager
|
from django.db.models.manager import Manager
|
||||||
|
|
||||||
@@ -36,7 +36,7 @@ class CreateModel(ModelOperation):
|
|||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
name: str,
|
name: str,
|
||||||
fields: List[Tuple[str, Field]],
|
fields: List[Tuple[str, Union[CIText, Field]]],
|
||||||
options: Optional[
|
options: Optional[
|
||||||
Union[
|
Union[
|
||||||
Dict[str, Union[List[Any], bool]],
|
Dict[str, Union[List[Any], bool]],
|
||||||
@@ -52,55 +52,7 @@ class CreateModel(ModelOperation):
|
|||||||
) -> Tuple[
|
) -> Tuple[
|
||||||
str,
|
str,
|
||||||
List[Any],
|
List[Any],
|
||||||
Union[
|
Dict[str, Union[Dict[str, str], List[Tuple[str, Field]], str]],
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
Dict[str, str],
|
|
||||||
List[Union[Tuple[str, AutoField], Tuple[str, CharField]]],
|
|
||||||
str,
|
|
||||||
],
|
|
||||||
],
|
|
||||||
Dict[str, Union[List[Tuple[str, AutoField]], str]],
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
List[
|
|
||||||
Union[
|
|
||||||
Tuple[str, AutoField],
|
|
||||||
Tuple[str, BooleanField],
|
|
||||||
Tuple[str, CharField],
|
|
||||||
Tuple[str, IntegerField],
|
|
||||||
Tuple[str, SlugField],
|
|
||||||
]
|
|
||||||
],
|
|
||||||
str,
|
|
||||||
],
|
|
||||||
],
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
List[
|
|
||||||
Union[Tuple[str, AutoField], Tuple[str, BooleanField]]
|
|
||||||
],
|
|
||||||
str,
|
|
||||||
],
|
|
||||||
],
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
List[
|
|
||||||
Union[
|
|
||||||
Tuple[str, AutoField],
|
|
||||||
Tuple[str, CharField],
|
|
||||||
Tuple[str, IntegerField],
|
|
||||||
Tuple[str, SlugField],
|
|
||||||
]
|
|
||||||
],
|
|
||||||
str,
|
|
||||||
],
|
|
||||||
],
|
|
||||||
],
|
|
||||||
]: ...
|
]: ...
|
||||||
def state_forwards(self, app_label: str, state: ProjectState) -> None: ...
|
def state_forwards(self, app_label: str, state: ProjectState) -> None: ...
|
||||||
def database_forwards(
|
def database_forwards(
|
||||||
|
|||||||
@@ -1,22 +1,9 @@
|
|||||||
from typing import Any, Callable, Dict, List, Optional, Set, Tuple, Union
|
from typing import Any, Callable, Dict, List, Optional, Set, Tuple, Union
|
||||||
|
|
||||||
from django.db.models.fields import Field
|
|
||||||
|
|
||||||
|
|
||||||
class BaseSerializer:
|
class BaseSerializer:
|
||||||
value: Any = ...
|
value: Any = ...
|
||||||
def __init__(
|
def __init__(self, value: Any) -> None: ...
|
||||||
self,
|
|
||||||
value: Union[
|
|
||||||
Callable,
|
|
||||||
List[Tuple[str, str]],
|
|
||||||
Set[Tuple[str, str]],
|
|
||||||
Tuple[str, Union[Field, str]],
|
|
||||||
Field,
|
|
||||||
int,
|
|
||||||
str,
|
|
||||||
],
|
|
||||||
) -> None: ...
|
|
||||||
def serialize(self) -> None: ...
|
def serialize(self) -> None: ...
|
||||||
|
|
||||||
class BaseSequenceSerializer(BaseSerializer):
|
class BaseSequenceSerializer(BaseSerializer):
|
||||||
@@ -97,14 +84,4 @@ class TypeSerializer(BaseSerializer):
|
|||||||
class UUIDSerializer(BaseSerializer):
|
class UUIDSerializer(BaseSerializer):
|
||||||
def serialize(self): ...
|
def serialize(self): ...
|
||||||
|
|
||||||
def serializer_factory(
|
def serializer_factory(value: Any) -> BaseSerializer: ...
|
||||||
value: Union[
|
|
||||||
Callable,
|
|
||||||
List[Tuple[str, str]],
|
|
||||||
Set[Tuple[str, str]],
|
|
||||||
Tuple[str, Union[Field, str]],
|
|
||||||
Field,
|
|
||||||
int,
|
|
||||||
str,
|
|
||||||
]
|
|
||||||
) -> BaseSerializer: ...
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
from typing import Any, Dict, Iterator, List, Optional, Set, Tuple, Type, Union
|
from typing import Any, Dict, Iterator, List, Optional, Set, Tuple, Type, Union
|
||||||
|
|
||||||
from django.apps.registry import Apps
|
from django.apps.registry import Apps
|
||||||
|
from django.contrib.postgres.fields.citext import CIText
|
||||||
from django.db.models.base import Model
|
from django.db.models.base import Model
|
||||||
from django.db.models.fields import Field
|
from django.db.models.fields import Field
|
||||||
from django.db.models.indexes import Index
|
from django.db.models.indexes import Index
|
||||||
@@ -23,21 +24,21 @@ class ModelState:
|
|||||||
self,
|
self,
|
||||||
app_label: str,
|
app_label: str,
|
||||||
name: str,
|
name: str,
|
||||||
fields: List[Tuple[str, Field]],
|
fields: List[Tuple[str, Union[CIText, Field]]],
|
||||||
options: Optional[
|
options: Optional[
|
||||||
Union[
|
Union[
|
||||||
Dict[str, Optional[List[Index]]],
|
Dict[str, Optional[List[Index]]],
|
||||||
Dict[str, Union[List[Any], List[Tuple[str, str]], str]],
|
|
||||||
Dict[str, Union[List[Index], bool, str]],
|
|
||||||
Dict[
|
Dict[
|
||||||
str,
|
str,
|
||||||
Union[
|
Union[
|
||||||
List[str],
|
List[Tuple[str, str]],
|
||||||
Set[Union[Tuple[str, str, str, str], Tuple[str, str]]],
|
Set[Tuple[str, str]],
|
||||||
Tuple[str],
|
Tuple[str],
|
||||||
str,
|
str,
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
|
Dict[str, Union[List[Index], bool]],
|
||||||
|
Dict[str, Union[List[str], Set[Tuple[str, str]]]],
|
||||||
Dict[str, Union[List[str], Tuple, bool]],
|
Dict[str, Union[List[str], Tuple, bool]],
|
||||||
Dict[str, Union[List[str], bool, str]],
|
Dict[str, Union[List[str], bool, str]],
|
||||||
Dict[str, Union[Set[Tuple[str, str]], bool]],
|
Dict[str, Union[Set[Tuple[str, str]], bool]],
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
from typing import Any, List, Optional, Set, Tuple, Type, Union
|
from typing import Any, Optional, Set, Tuple, Type
|
||||||
|
|
||||||
from django.db.migrations.migration import Migration
|
from django.db.migrations.migration import Migration
|
||||||
from django.db.migrations.operations.base import Operation
|
from django.db.migrations.operations.base import Operation
|
||||||
from django.db.models.fields import Field
|
|
||||||
|
|
||||||
|
|
||||||
class SettingsReference(str):
|
class SettingsReference(str):
|
||||||
@@ -37,16 +36,6 @@ class MigrationWriter:
|
|||||||
@property
|
@property
|
||||||
def path(self) -> str: ...
|
def path(self) -> str: ...
|
||||||
@classmethod
|
@classmethod
|
||||||
def serialize(
|
def serialize(cls, value: Any) -> Tuple[str, Set[str]]: ...
|
||||||
cls,
|
|
||||||
value: Union[
|
|
||||||
List[Tuple[str, str]],
|
|
||||||
Set[Tuple[str, str]],
|
|
||||||
Tuple[str, Union[Field, str]],
|
|
||||||
bool,
|
|
||||||
Field,
|
|
||||||
str,
|
|
||||||
],
|
|
||||||
) -> Tuple[str, Set[str]]: ...
|
|
||||||
|
|
||||||
MIGRATION_TEMPLATE: str
|
MIGRATION_TEMPLATE: str
|
||||||
|
|||||||
@@ -5,14 +5,12 @@ from uuid import UUID
|
|||||||
|
|
||||||
from django.contrib.auth.models import AbstractUser, PermissionsMixin
|
from django.contrib.auth.models import AbstractUser, PermissionsMixin
|
||||||
from django.contrib.contenttypes.fields import GenericForeignKey
|
from django.contrib.contenttypes.fields import GenericForeignKey
|
||||||
from django.contrib.sessions.base_session import AbstractBaseSession
|
|
||||||
from django.core.checks.messages import Warning
|
from django.core.checks.messages import Warning
|
||||||
from django.core.exceptions import (MultipleObjectsReturned,
|
from django.core.exceptions import (MultipleObjectsReturned,
|
||||||
ObjectDoesNotExist, ValidationError)
|
ObjectDoesNotExist, ValidationError)
|
||||||
from django.db.models.fields import CharField, Field
|
from django.db.models.fields import CharField, Field
|
||||||
from django.db.models.fields.related import ForeignKey
|
from django.db.models.fields.related import ForeignKey
|
||||||
from django.db.models.manager import Manager
|
from django.db.models.manager import Manager
|
||||||
from django.db.models.options import Options
|
|
||||||
|
|
||||||
|
|
||||||
class Deferred: ...
|
class Deferred: ...
|
||||||
@@ -22,7 +20,8 @@ DEFERRED: Any
|
|||||||
def subclass_exception(
|
def subclass_exception(
|
||||||
name: str,
|
name: str,
|
||||||
bases: Tuple[
|
bases: Tuple[
|
||||||
Union[Type[MultipleObjectsReturned], Type[ObjectDoesNotExist]]
|
Union[Type[MultipleObjectsReturned], Type[ObjectDoesNotExist]],
|
||||||
|
Type[Exception],
|
||||||
],
|
],
|
||||||
module: str,
|
module: str,
|
||||||
attached_to: Type[Model],
|
attached_to: Type[Model],
|
||||||
@@ -34,36 +33,20 @@ class ModelBase(type):
|
|||||||
name: str,
|
name: str,
|
||||||
bases: Tuple[Type[Model]],
|
bases: Tuple[Type[Model]],
|
||||||
attrs: Union[
|
attrs: Union[
|
||||||
|
Dict[str, Any],
|
||||||
Dict[
|
Dict[
|
||||||
str,
|
str,
|
||||||
Union[
|
Union[
|
||||||
Callable,
|
Callable,
|
||||||
Tuple[Tuple[int, str], Tuple[int, str]],
|
Tuple[Tuple[int, str], Tuple[int, str]],
|
||||||
Type[AbstractUser.Meta],
|
|
||||||
Field,
|
Field,
|
||||||
property,
|
|
||||||
str,
|
|
||||||
],
|
|
||||||
],
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
Callable, Type[Any], Type[PermissionsMixin.Meta], Field, str
|
|
||||||
],
|
|
||||||
],
|
|
||||||
Dict[str, Union[Callable, Type[Any], CharField, Manager, str]],
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
Callable,
|
|
||||||
Type[AbstractBaseSession.Meta],
|
|
||||||
classmethod,
|
|
||||||
GenericForeignKey,
|
|
||||||
Field,
|
|
||||||
Manager,
|
|
||||||
str,
|
str,
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
|
Dict[str, Union[Callable, Type[Any], Field, Manager, str]],
|
||||||
|
Dict[str, Union[Callable, Type[PermissionsMixin.Meta], Field, str]],
|
||||||
|
Dict[str, Union[Callable, GenericForeignKey, Field, str]],
|
||||||
|
Dict[str, Union[Callable, Field, property, str]],
|
||||||
Dict[
|
Dict[
|
||||||
str,
|
str,
|
||||||
Union[
|
Union[
|
||||||
@@ -75,33 +58,11 @@ class ModelBase(type):
|
|||||||
str,
|
str,
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
|
Dict[str, Union[Type[AbstractUser.Meta], str]],
|
||||||
],
|
],
|
||||||
**kwargs: Any
|
**kwargs: Any
|
||||||
) -> Type[Model]: ...
|
) -> Type[Model]: ...
|
||||||
def add_to_class(
|
def add_to_class(cls, name: str, value: Any) -> None: ...
|
||||||
cls,
|
|
||||||
name: str,
|
|
||||||
value: Optional[
|
|
||||||
Union[
|
|
||||||
Callable,
|
|
||||||
List[str],
|
|
||||||
Tuple[Tuple[int, str], Tuple[int, str]],
|
|
||||||
Tuple[
|
|
||||||
Tuple[str, Tuple[Tuple[str, str], Tuple[str, str]]],
|
|
||||||
Tuple[str, str],
|
|
||||||
],
|
|
||||||
Type[Union[MultipleObjectsReturned, ObjectDoesNotExist]],
|
|
||||||
bool,
|
|
||||||
classmethod,
|
|
||||||
GenericForeignKey,
|
|
||||||
Field,
|
|
||||||
Manager,
|
|
||||||
Options,
|
|
||||||
property,
|
|
||||||
str,
|
|
||||||
]
|
|
||||||
],
|
|
||||||
) -> None: ...
|
|
||||||
|
|
||||||
class ModelStateFieldsCacheDescriptor:
|
class ModelStateFieldsCacheDescriptor:
|
||||||
def __get__(
|
def __get__(
|
||||||
@@ -129,12 +90,7 @@ class Model:
|
|||||||
Tuple[Union[int, str]],
|
Tuple[Union[int, str]],
|
||||||
],
|
],
|
||||||
) -> Model: ...
|
) -> Model: ...
|
||||||
def __eq__(
|
def __eq__(self, other: Any) -> bool: ...
|
||||||
self,
|
|
||||||
other: Optional[
|
|
||||||
Union[Dict[Any, Any], List[Any], Tuple, Model, int, str]
|
|
||||||
],
|
|
||||||
) -> bool: ...
|
|
||||||
def __hash__(self) -> int: ...
|
def __hash__(self) -> int: ...
|
||||||
def __reduce__(self): ...
|
def __reduce__(self): ...
|
||||||
pk: Any = ...
|
pk: Any = ...
|
||||||
|
|||||||
@@ -6,10 +6,10 @@ from typing import (Any, Callable, Dict, Iterator, List, Optional, Set, Tuple,
|
|||||||
from uuid import UUID
|
from uuid import UUID
|
||||||
|
|
||||||
from django.db.backends.sqlite3.base import DatabaseWrapper
|
from django.db.backends.sqlite3.base import DatabaseWrapper
|
||||||
from django.db.models.aggregates import Aggregate, Count
|
from django.db.models.aggregates import Aggregate, Count, Sum
|
||||||
from django.db.models.fields import (AutoField, BinaryField, BooleanField,
|
from django.db.models.fields import (AutoField, BinaryField, BooleanField,
|
||||||
CharField, DateField, DurationField,
|
DateTimeField, DurationField, Field,
|
||||||
Field, IntegerField, TimeField, UUIDField)
|
IntegerField, TimeField, UUIDField)
|
||||||
from django.db.models.fields.mixins import FieldCacheMixin
|
from django.db.models.fields.mixins import FieldCacheMixin
|
||||||
from django.db.models.fields.reverse_related import ForeignObjectRel
|
from django.db.models.fields.reverse_related import ForeignObjectRel
|
||||||
from django.db.models.functions.window import DenseRank
|
from django.db.models.functions.window import DenseRank
|
||||||
@@ -45,20 +45,16 @@ class Combinable:
|
|||||||
BITLEFTSHIFT: str = ...
|
BITLEFTSHIFT: str = ...
|
||||||
BITRIGHTSHIFT: str = ...
|
BITRIGHTSHIFT: str = ...
|
||||||
def __neg__(self) -> CombinedExpression: ...
|
def __neg__(self) -> CombinedExpression: ...
|
||||||
def __add__(
|
def __add__(self, other: Any) -> CombinedExpression: ...
|
||||||
self, other: Optional[Union[timedelta, Combinable, float, int, str]]
|
|
||||||
) -> CombinedExpression: ...
|
|
||||||
def __sub__(
|
def __sub__(
|
||||||
self, other: Union[timedelta, Combinable, float, int]
|
self, other: Union[timedelta, Combinable, float]
|
||||||
) -> CombinedExpression: ...
|
) -> CombinedExpression: ...
|
||||||
def __mul__(
|
def __mul__(
|
||||||
self, other: Union[timedelta, Combinable, float, int]
|
self, other: Union[timedelta, Combinable, float]
|
||||||
) -> CombinedExpression: ...
|
|
||||||
def __truediv__(
|
|
||||||
self, other: Union[Count, float, int]
|
|
||||||
) -> CombinedExpression: ...
|
) -> CombinedExpression: ...
|
||||||
|
def __truediv__(self, other: Union[Count, float]) -> CombinedExpression: ...
|
||||||
def __mod__(self, other: int) -> CombinedExpression: ...
|
def __mod__(self, other: int) -> CombinedExpression: ...
|
||||||
def __pow__(self, other: Union[float, int]) -> CombinedExpression: ...
|
def __pow__(self, other: float) -> CombinedExpression: ...
|
||||||
def __and__(self, other: Combinable) -> Any: ...
|
def __and__(self, other: Combinable) -> Any: ...
|
||||||
def bitand(self, other: int) -> CombinedExpression: ...
|
def bitand(self, other: int) -> CombinedExpression: ...
|
||||||
def bitleftshift(self, other: int) -> CombinedExpression: ...
|
def bitleftshift(self, other: int) -> CombinedExpression: ...
|
||||||
@@ -66,13 +62,13 @@ class Combinable:
|
|||||||
def __or__(self, other: Combinable) -> Any: ...
|
def __or__(self, other: Combinable) -> Any: ...
|
||||||
def bitor(self, other: int) -> CombinedExpression: ...
|
def bitor(self, other: int) -> CombinedExpression: ...
|
||||||
def __radd__(
|
def __radd__(
|
||||||
self, other: Optional[Union[datetime, timedelta, float, int]]
|
self, other: Optional[Union[datetime, timedelta, float]]
|
||||||
) -> CombinedExpression: ...
|
) -> CombinedExpression: ...
|
||||||
def __rsub__(self, other: Union[float, int]) -> CombinedExpression: ...
|
def __rsub__(self, other: float) -> CombinedExpression: ...
|
||||||
def __rmul__(self, other: Union[float, int]) -> CombinedExpression: ...
|
def __rmul__(self, other: float) -> CombinedExpression: ...
|
||||||
def __rtruediv__(self, other: Union[float, int]) -> CombinedExpression: ...
|
def __rtruediv__(self, other: float) -> CombinedExpression: ...
|
||||||
def __rmod__(self, other: int) -> CombinedExpression: ...
|
def __rmod__(self, other: int) -> CombinedExpression: ...
|
||||||
def __rpow__(self, other: Union[float, int]) -> CombinedExpression: ...
|
def __rpow__(self, other: float) -> CombinedExpression: ...
|
||||||
def __rand__(self, other: Any) -> Any: ...
|
def __rand__(self, other: Any) -> Any: ...
|
||||||
def __ror__(self, other: Any) -> Any: ...
|
def __ror__(self, other: Any) -> Any: ...
|
||||||
|
|
||||||
@@ -105,7 +101,7 @@ class BaseExpression:
|
|||||||
for_save: bool = ...,
|
for_save: bool = ...,
|
||||||
) -> BaseExpression: ...
|
) -> BaseExpression: ...
|
||||||
@property
|
@property
|
||||||
def field(self) -> Union[Field, mixins.FieldCacheMixin]: ...
|
def field(self) -> Union[Field, ForeignObjectRel]: ...
|
||||||
def output_field(self) -> Field: ...
|
def output_field(self) -> Field: ...
|
||||||
def convert_value(self) -> Callable: ...
|
def convert_value(self) -> Callable: ...
|
||||||
def get_lookup(self, lookup: str) -> Optional[Type[Lookup]]: ...
|
def get_lookup(self, lookup: str) -> Optional[Type[Lookup]]: ...
|
||||||
@@ -136,7 +132,9 @@ class CombinedExpression(SQLiteNumericMixin, Expression):
|
|||||||
rhs: Combinable,
|
rhs: Combinable,
|
||||||
output_field: None = ...,
|
output_field: None = ...,
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
def get_source_expressions(self) -> List[Combinable]: ...
|
def get_source_expressions(
|
||||||
|
self
|
||||||
|
) -> Union[List[Combinable], List[SQLiteNumericMixin]]: ...
|
||||||
def set_source_expressions(self, exprs: List[Combinable]) -> None: ...
|
def set_source_expressions(self, exprs: List[Combinable]) -> None: ...
|
||||||
def as_sql(
|
def as_sql(
|
||||||
self, compiler: SQLCompiler, connection: DatabaseWrapper
|
self, compiler: SQLCompiler, connection: DatabaseWrapper
|
||||||
@@ -213,7 +211,7 @@ class Func(SQLiteNumericMixin, Expression):
|
|||||||
def __init__(
|
def __init__(
|
||||||
self, *expressions: Any, output_field: Optional[Any] = ..., **extra: Any
|
self, *expressions: Any, output_field: Optional[Any] = ..., **extra: Any
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
def get_source_expressions(self) -> List[Union[Expression, F]]: ...
|
def get_source_expressions(self) -> List[Combinable]: ...
|
||||||
def set_source_expressions(self, exprs: List[Expression]) -> None: ...
|
def set_source_expressions(self, exprs: List[Expression]) -> None: ...
|
||||||
def resolve_expression(
|
def resolve_expression(
|
||||||
self,
|
self,
|
||||||
@@ -240,11 +238,7 @@ class Func(SQLiteNumericMixin, Expression):
|
|||||||
class Value(Expression):
|
class Value(Expression):
|
||||||
value: Any = ...
|
value: Any = ...
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self, value: Any, output_field: Optional[Field] = ...
|
||||||
value: Optional[
|
|
||||||
Union[bytes, date, time, timedelta, Decimal, float, int, str, UUID]
|
|
||||||
],
|
|
||||||
output_field: Optional[Field] = ...,
|
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
def as_sql(
|
def as_sql(
|
||||||
self, compiler: SQLCompiler, connection: DatabaseWrapper
|
self, compiler: SQLCompiler, connection: DatabaseWrapper
|
||||||
@@ -307,7 +301,9 @@ class Col(Expression):
|
|||||||
self,
|
self,
|
||||||
alias: str,
|
alias: str,
|
||||||
target: Union[Field, str],
|
target: Union[Field, str],
|
||||||
output_field: Optional[Union[Field, mixins.FieldCacheMixin]] = ...,
|
output_field: Optional[
|
||||||
|
Union[Field, reverse_related.ForeignObjectRel]
|
||||||
|
] = ...,
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
def as_sql(
|
def as_sql(
|
||||||
self, compiler: SQLCompiler, connection: DatabaseWrapper
|
self, compiler: SQLCompiler, connection: DatabaseWrapper
|
||||||
@@ -320,9 +316,7 @@ class Col(Expression):
|
|||||||
|
|
||||||
class Ref(Expression):
|
class Ref(Expression):
|
||||||
def __init__(self, refs: str, source: Expression) -> None: ...
|
def __init__(self, refs: str, source: Expression) -> None: ...
|
||||||
def get_source_expressions(
|
def get_source_expressions(self) -> List[Expression]: ...
|
||||||
self
|
|
||||||
) -> Union[List[Expression], List[SQLiteNumericMixin]]: ...
|
|
||||||
def set_source_expressions(self, exprs: Any) -> None: ...
|
def set_source_expressions(self, exprs: Any) -> None: ...
|
||||||
def resolve_expression(
|
def resolve_expression(
|
||||||
self,
|
self,
|
||||||
@@ -363,10 +357,7 @@ class When(Expression):
|
|||||||
condition: Any = ...
|
condition: Any = ...
|
||||||
result: Any = ...
|
result: Any = ...
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self, condition: Any = ..., then: Any = ..., **lookups: Any
|
||||||
condition: Any = ...,
|
|
||||||
then: Optional[Union[date, Decimal, Combinable, float, int, str]] = ...,
|
|
||||||
**lookups: Any
|
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
def get_source_expressions(self) -> List[Union[Expression, WhereNode]]: ...
|
def get_source_expressions(self) -> List[Union[Expression, WhereNode]]: ...
|
||||||
def set_source_expressions(
|
def set_source_expressions(
|
||||||
@@ -393,9 +384,9 @@ class When(Expression):
|
|||||||
List[Union[date, int]],
|
List[Union[date, int]],
|
||||||
List[Union[date, str]],
|
List[Union[date, str]],
|
||||||
List[Union[Decimal, int]],
|
List[Union[Decimal, int]],
|
||||||
List[Union[float, int]],
|
|
||||||
List[Union[int, memoryview]],
|
List[Union[int, memoryview]],
|
||||||
List[Union[int, str]],
|
List[Union[int, str]],
|
||||||
|
List[float],
|
||||||
],
|
],
|
||||||
]: ...
|
]: ...
|
||||||
def get_group_by_cols(self) -> List[Col]: ...
|
def get_group_by_cols(self) -> List[Col]: ...
|
||||||
@@ -437,9 +428,9 @@ class Case(Expression):
|
|||||||
List[Union[date, int]],
|
List[Union[date, int]],
|
||||||
List[Union[date, str]],
|
List[Union[date, str]],
|
||||||
List[Union[Decimal, int]],
|
List[Union[Decimal, int]],
|
||||||
List[Union[float, int]],
|
|
||||||
List[Union[int, memoryview]],
|
List[Union[int, memoryview]],
|
||||||
List[Union[int, str]],
|
List[Union[int, str]],
|
||||||
|
List[float],
|
||||||
],
|
],
|
||||||
]: ...
|
]: ...
|
||||||
|
|
||||||
|
|||||||
@@ -1,13 +1,24 @@
|
|||||||
|
from datetime import date, datetime, time, timedelta
|
||||||
|
from decimal import Context, Decimal
|
||||||
from typing import Any, Callable, Dict, List, Optional, Tuple, Type, Union
|
from typing import Any, Callable, Dict, List, Optional, Tuple, Type, Union
|
||||||
|
from uuid import UUID
|
||||||
|
|
||||||
|
from django.contrib.auth.validators import UnicodeUsernameValidator
|
||||||
from django.core.exceptions import FieldDoesNotExist as FieldDoesNotExist
|
from django.core.exceptions import FieldDoesNotExist as FieldDoesNotExist
|
||||||
from django.core.validators import EmailValidator, RegexValidator
|
from django.core.validators import DecimalValidator
|
||||||
from django.db.backends.sqlite3.base import DatabaseWrapper
|
from django.db.backends.sqlite3.base import DatabaseWrapper
|
||||||
from django.db.models.base import Model
|
from django.db.models.base import Model
|
||||||
from django.db.models.fields.reverse_related import ManyToOneRel
|
from django.db.models.expressions import Col, CombinedExpression
|
||||||
|
from django.db.models.fields.files import FieldFile
|
||||||
|
from django.db.models.fields.reverse_related import ForeignObjectRel
|
||||||
|
from django.db.models.query import QuerySet
|
||||||
from django.db.models.query_utils import RegisterLookupMixin
|
from django.db.models.query_utils import RegisterLookupMixin
|
||||||
from django.forms.fields import (DecimalField, Field, ImageField, IntegerField,
|
from django.db.models.sql.compiler import SQLCompiler, SQLInsertCompiler
|
||||||
TypedChoiceField, URLField)
|
from django.forms.fields import (BooleanField, DurationField, EmailField,
|
||||||
|
Field, FloatField, GenericIPAddressField,
|
||||||
|
IntegerField, SlugField,
|
||||||
|
TypedMultipleChoiceField, URLField, UUIDField)
|
||||||
|
from django.utils.datastructures import DictWrapper
|
||||||
|
|
||||||
|
|
||||||
class Empty: ...
|
class Empty: ...
|
||||||
@@ -51,99 +62,167 @@ class Field(RegisterLookupMixin):
|
|||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
verbose_name: Optional[str] = ...,
|
verbose_name: Optional[str] = ...,
|
||||||
name: None = ...,
|
name: Optional[str] = ...,
|
||||||
primary_key: bool = ...,
|
primary_key: bool = ...,
|
||||||
max_length: Optional[int] = ...,
|
max_length: Optional[int] = ...,
|
||||||
unique: bool = ...,
|
unique: bool = ...,
|
||||||
blank: bool = ...,
|
blank: bool = ...,
|
||||||
null: bool = ...,
|
null: bool = ...,
|
||||||
db_index: bool = ...,
|
db_index: bool = ...,
|
||||||
rel: Optional[ManyToOneRel] = ...,
|
rel: Optional[ForeignObjectRel] = ...,
|
||||||
default: Union[Callable, Type[NOT_PROVIDED]] = ...,
|
default: Any = ...,
|
||||||
editable: bool = ...,
|
editable: bool = ...,
|
||||||
serialize: bool = ...,
|
serialize: bool = ...,
|
||||||
unique_for_date: Optional[str] = ...,
|
unique_for_date: None = ...,
|
||||||
unique_for_month: Optional[str] = ...,
|
unique_for_month: None = ...,
|
||||||
unique_for_year: Optional[str] = ...,
|
unique_for_year: None = ...,
|
||||||
choices: Optional[
|
choices: Optional[
|
||||||
Union[
|
Union[
|
||||||
List[Tuple[str, str]],
|
List[List[Union[List[List[str]], str]]],
|
||||||
List[Tuple[int, str]],
|
List[
|
||||||
Tuple[Tuple[int, str], Tuple[int, str], Tuple[int, str]],
|
Tuple[
|
||||||
Tuple[Tuple[str, str], Tuple[str, str]],
|
Union[int, str],
|
||||||
|
Union[
|
||||||
|
Tuple[
|
||||||
|
Tuple[str, str],
|
||||||
|
Tuple[str, str],
|
||||||
|
Tuple[str, str],
|
||||||
|
],
|
||||||
|
Tuple[Tuple[str, str], Tuple[str, str]],
|
||||||
|
int,
|
||||||
|
str,
|
||||||
|
],
|
||||||
|
]
|
||||||
|
],
|
||||||
|
Tuple[
|
||||||
|
Union[
|
||||||
|
Tuple[int, Union[int, str]],
|
||||||
|
Tuple[
|
||||||
|
str,
|
||||||
|
Union[Tuple[Tuple[int, str], Tuple[int, str]], str],
|
||||||
|
],
|
||||||
|
]
|
||||||
|
],
|
||||||
]
|
]
|
||||||
] = ...,
|
] = ...,
|
||||||
help_text: str = ...,
|
help_text: str = ...,
|
||||||
db_column: None = ...,
|
db_column: Optional[str] = ...,
|
||||||
db_tablespace: Optional[str] = ...,
|
db_tablespace: Optional[str] = ...,
|
||||||
auto_created: bool = ...,
|
auto_created: bool = ...,
|
||||||
validators: Union[List[RegexValidator], Tuple] = ...,
|
validators: Union[List[Callable], Tuple] = ...,
|
||||||
error_messages: Optional[Dict[str, str]] = ...,
|
error_messages: None = ...,
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
def check(self, **kwargs: Any): ...
|
def check(self, **kwargs: Any) -> List[Any]: ...
|
||||||
def get_col(self, alias: Any, output_field: Optional[Any] = ...): ...
|
def get_col(
|
||||||
def cached_col(self): ...
|
self,
|
||||||
def select_format(self, compiler: Any, sql: Any, params: Any): ...
|
alias: str,
|
||||||
|
output_field: Optional[Union[Field, ForeignObjectRel]] = ...,
|
||||||
|
) -> Col: ...
|
||||||
|
def cached_col(self) -> Col: ...
|
||||||
|
def select_format(
|
||||||
|
self, compiler: SQLCompiler, sql: str, params: List[Union[int, str]]
|
||||||
|
) -> Tuple[str, List[Union[int, str]]]: ...
|
||||||
def deconstruct(
|
def deconstruct(
|
||||||
self
|
self
|
||||||
) -> Union[
|
) -> Union[
|
||||||
|
Tuple[None, str, List[Any], Dict[str, Union[List[Callable], int, str]]],
|
||||||
Tuple[
|
Tuple[
|
||||||
str,
|
str,
|
||||||
List[Any],
|
List[Any],
|
||||||
Union[
|
Union[
|
||||||
Dict[str, Union[int, List[RegexValidator], Dict[str, str]]],
|
Dict[str, Optional[bool]],
|
||||||
Dict[str, Union[bool, List[Tuple[int, str]]]],
|
Dict[str, Union[Callable, int, str]],
|
||||||
Dict[str, Union[Callable, List[Tuple[int, str]]]],
|
Dict[str, Union[List[Tuple[int, str]], int]],
|
||||||
Dict[str, int],
|
Dict[
|
||||||
|
str,
|
||||||
|
Union[
|
||||||
|
List[
|
||||||
|
Tuple[
|
||||||
|
str,
|
||||||
|
Union[
|
||||||
|
Tuple[Tuple[str, str], Tuple[str, str]], str
|
||||||
|
],
|
||||||
|
]
|
||||||
|
],
|
||||||
|
int,
|
||||||
|
],
|
||||||
|
],
|
||||||
|
Dict[str, Union[List[Tuple[str, str]], int]],
|
||||||
|
Dict[str, Union[List[UnicodeUsernameValidator], int, str]],
|
||||||
|
Dict[str, float],
|
||||||
],
|
],
|
||||||
Union[
|
Union[
|
||||||
Dict[str, Union[int, List[RegexValidator], Dict[str, str]]],
|
Dict[str, Optional[bool]],
|
||||||
Dict[str, Union[bool, List[Tuple[int, str]]]],
|
Dict[str, Union[Callable, int, str]],
|
||||||
Dict[str, Union[Callable, List[Tuple[int, str]]]],
|
Dict[str, Union[List[Tuple[int, str]], int]],
|
||||||
Dict[str, int],
|
Dict[
|
||||||
Dict[Any, Any],
|
str,
|
||||||
|
Union[
|
||||||
|
List[
|
||||||
|
Tuple[
|
||||||
|
str,
|
||||||
|
Union[
|
||||||
|
Tuple[Tuple[str, str], Tuple[str, str]], str
|
||||||
|
],
|
||||||
|
]
|
||||||
|
],
|
||||||
|
int,
|
||||||
|
],
|
||||||
|
],
|
||||||
|
Dict[str, Union[List[Tuple[str, str]], int]],
|
||||||
|
Dict[str, Union[List[UnicodeUsernameValidator], int, str]],
|
||||||
|
Dict[str, float],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
Tuple[
|
Tuple[
|
||||||
str,
|
str,
|
||||||
List[Any],
|
List[Any],
|
||||||
Union[
|
Union[
|
||||||
Dict[str, Union[int, Callable, List[Tuple[str, str]]]],
|
Dict[str, Optional[bool]],
|
||||||
Dict[str, Union[Callable, List[Tuple[int, str]]]],
|
Dict[str, Union[List[Tuple[int, str]], str]],
|
||||||
Dict[str, Union[int, List[RegexValidator], Dict[str, str]]],
|
|
||||||
],
|
],
|
||||||
Union[
|
Union[
|
||||||
Dict[str, Union[int, Callable, List[Tuple[str, str]]]],
|
Dict[str, List[Tuple[int, str]]],
|
||||||
Dict[str, Union[Callable, List[Tuple[int, str]]]],
|
Dict[str, Optional[bool]],
|
||||||
Dict[str, Union[int, List[RegexValidator], Dict[str, str]]],
|
Dict[str, Union[List[Tuple[int, str]], str]],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
]: ...
|
]: ...
|
||||||
def clone(self) -> Field: ...
|
def clone(self) -> Field: ...
|
||||||
def __eq__(self, other: CharField) -> bool: ...
|
def __eq__(self, other: Field) -> bool: ...
|
||||||
def __lt__(self, other: Field) -> bool: ...
|
def __lt__(self, other: Field) -> bool: ...
|
||||||
def __hash__(self): ...
|
def __hash__(self) -> int: ...
|
||||||
def __deepcopy__(self, memodict: Dict[Any, Any]) -> Field: ...
|
def __deepcopy__(
|
||||||
|
self,
|
||||||
|
memodict: Union[
|
||||||
|
Dict[int, Any],
|
||||||
|
Dict[int, Union[Dict[str, Field], List[Field], Field]],
|
||||||
|
],
|
||||||
|
) -> Field: ...
|
||||||
def __copy__(self) -> Field: ...
|
def __copy__(self) -> Field: ...
|
||||||
def __reduce__(self): ...
|
def __reduce__(self): ...
|
||||||
def get_pk_value_on_save(self, instance: Model) -> None: ...
|
def get_pk_value_on_save(self, instance: Model) -> Optional[UUID]: ...
|
||||||
def to_python(self, value: Any): ...
|
def to_python(self, value: FieldFile) -> FieldFile: ...
|
||||||
def validators(
|
def validators(self) -> List[Callable]: ...
|
||||||
self
|
def run_validators(self, value: Any) -> None: ...
|
||||||
) -> Union[List[RegexValidator], List[EmailValidator]]: ...
|
def validate(self, value: Any, model_instance: Optional[Model]) -> None: ...
|
||||||
def run_validators(self, value: Any): ...
|
def clean(self, value: Any, model_instance: Optional[Model]) -> Any: ...
|
||||||
def validate(self, value: Any, model_instance: Any): ...
|
def db_type_parameters(
|
||||||
def clean(self, value: Any, model_instance: Any): ...
|
self, connection: DatabaseWrapper
|
||||||
def db_type_parameters(self, connection: Any): ...
|
) -> DictWrapper: ...
|
||||||
def db_check(self, connection: Any): ...
|
def db_check(self, connection: DatabaseWrapper) -> None: ...
|
||||||
def db_type(self, connection: Any): ...
|
def db_type(self, connection: DatabaseWrapper) -> str: ...
|
||||||
def rel_db_type(self, connection: Any): ...
|
def rel_db_type(self, connection: DatabaseWrapper) -> str: ...
|
||||||
def cast_db_type(self, connection: Any): ...
|
def cast_db_type(self, connection: Any): ...
|
||||||
def db_parameters(self, connection: Any): ...
|
def db_parameters(
|
||||||
def db_type_suffix(self, connection: Any): ...
|
self, connection: DatabaseWrapper
|
||||||
def get_db_converters(self, connection: Any): ...
|
) -> Dict[str, Optional[str]]: ...
|
||||||
|
def db_type_suffix(self, connection: DatabaseWrapper) -> Optional[str]: ...
|
||||||
|
def get_db_converters(
|
||||||
|
self, connection: DatabaseWrapper
|
||||||
|
) -> List[Callable]: ...
|
||||||
@property
|
@property
|
||||||
def unique(self): ...
|
def unique(self) -> bool: ...
|
||||||
@property
|
@property
|
||||||
def db_tablespace(self) -> str: ...
|
def db_tablespace(self) -> str: ...
|
||||||
concrete: Any = ...
|
concrete: Any = ...
|
||||||
@@ -155,75 +234,116 @@ class Field(RegisterLookupMixin):
|
|||||||
def get_filter_kwargs_for_object(self, obj: Any): ...
|
def get_filter_kwargs_for_object(self, obj: Any): ...
|
||||||
def get_attname(self) -> str: ...
|
def get_attname(self) -> str: ...
|
||||||
def get_attname_column(self) -> Tuple[str, str]: ...
|
def get_attname_column(self) -> Tuple[str, str]: ...
|
||||||
def get_internal_type(self): ...
|
def get_internal_type(self) -> str: ...
|
||||||
def pre_save(self, model_instance: Model, add: bool) -> Union[str, int]: ...
|
def pre_save(self, model_instance: Model, add: bool) -> Any: ...
|
||||||
def get_prep_value(self, value: Any): ...
|
def get_prep_value(self, value: Any) -> Any: ...
|
||||||
def get_db_prep_value(
|
def get_db_prep_value(
|
||||||
self, value: int, connection: DatabaseWrapper, prepared: bool = ...
|
self, value: Any, connection: DatabaseWrapper, prepared: bool = ...
|
||||||
) -> int: ...
|
) -> Optional[Union[bytes, float, str]]: ...
|
||||||
def get_db_prep_save(self, value: Any, connection: Any): ...
|
def get_db_prep_save(
|
||||||
|
self, value: Any, connection: DatabaseWrapper
|
||||||
|
) -> Optional[Union[float, memoryview, str]]: ...
|
||||||
def has_default(self) -> bool: ...
|
def has_default(self) -> bool: ...
|
||||||
def get_default(self): ...
|
def get_default(self) -> Any: ...
|
||||||
def get_choices(
|
def get_choices(
|
||||||
self,
|
self,
|
||||||
include_blank: bool = ...,
|
include_blank: bool = ...,
|
||||||
blank_choice: List[Tuple[str, str]] = ...,
|
blank_choice: List[Tuple[str, str]] = ...,
|
||||||
limit_choices_to: None = ...,
|
limit_choices_to: Optional[Dict[str, QuerySet]] = ...,
|
||||||
) -> List[Tuple[str, str]]: ...
|
) -> List[
|
||||||
def value_to_string(self, obj: Any): ...
|
Union[
|
||||||
|
Tuple[
|
||||||
|
Union[
|
||||||
|
Tuple[Tuple[str, str], Tuple[str, str], Tuple[str, str]],
|
||||||
|
Tuple[Tuple[str, str], Tuple[str, str]],
|
||||||
|
str,
|
||||||
|
],
|
||||||
|
Union[
|
||||||
|
Tuple[Tuple[str, str], Tuple[str, str], Tuple[str, str]],
|
||||||
|
Tuple[Tuple[str, str], Tuple[str, str]],
|
||||||
|
str,
|
||||||
|
],
|
||||||
|
],
|
||||||
|
Tuple[int, int],
|
||||||
|
]
|
||||||
|
]: ...
|
||||||
|
def value_to_string(self, obj: Model) -> str: ...
|
||||||
flatchoices: Any = ...
|
flatchoices: Any = ...
|
||||||
def save_form_data(self, instance: Any, data: Any) -> None: ...
|
def save_form_data(
|
||||||
|
self, instance: Model, data: Optional[Union[date, Model, float, str]]
|
||||||
|
) -> None: ...
|
||||||
def formfield(
|
def formfield(
|
||||||
self,
|
self,
|
||||||
form_class: Type[Union[IntegerField, URLField, ImageField]] = ...,
|
form_class: Optional[Type[Any]] = ...,
|
||||||
choices_form_class: None = ...,
|
choices_form_class: Optional[Type[TypedMultipleChoiceField]] = ...,
|
||||||
**kwargs: Any
|
**kwargs: Any
|
||||||
) -> Field: ...
|
) -> Field: ...
|
||||||
def value_from_object(self, obj: Any): ...
|
def value_from_object(self, obj: Model) -> Any: ...
|
||||||
|
|
||||||
class AutoField(Field):
|
class AutoField(Field):
|
||||||
description: Any = ...
|
description: Any = ...
|
||||||
empty_strings_allowed: bool = ...
|
empty_strings_allowed: bool = ...
|
||||||
default_error_messages: Any = ...
|
default_error_messages: Any = ...
|
||||||
def __init__(self, *args: Any, **kwargs: Any) -> None: ...
|
def __init__(self, *args: Any, **kwargs: Any) -> None: ...
|
||||||
def check(self, **kwargs: Any): ...
|
def check(self, **kwargs: Any) -> List[Any]: ...
|
||||||
def deconstruct(self): ...
|
def deconstruct(
|
||||||
def get_internal_type(self): ...
|
self
|
||||||
def to_python(self, value: Any): ...
|
) -> Union[
|
||||||
def rel_db_type(self, connection: Any): ...
|
Tuple[
|
||||||
|
str,
|
||||||
|
List[Any],
|
||||||
|
Dict[str, Union[bool, str]],
|
||||||
|
Dict[str, Union[bool, str]],
|
||||||
|
],
|
||||||
|
Tuple[str, str, List[Any], Dict[str, bool]],
|
||||||
|
]: ...
|
||||||
|
def get_internal_type(self) -> str: ...
|
||||||
|
def to_python(self, value: Union[int, str]) -> int: ...
|
||||||
|
def rel_db_type(self, connection: DatabaseWrapper) -> str: ...
|
||||||
def validate(self, value: Any, model_instance: Any) -> None: ...
|
def validate(self, value: Any, model_instance: Any) -> None: ...
|
||||||
def get_db_prep_value(
|
def get_db_prep_value(
|
||||||
self, value: Any, connection: Any, prepared: bool = ...
|
self,
|
||||||
): ...
|
value: Union[int, str],
|
||||||
def get_prep_value(self, value: Any): ...
|
connection: DatabaseWrapper,
|
||||||
|
prepared: bool = ...,
|
||||||
|
) -> Union[int, str]: ...
|
||||||
|
def get_prep_value(
|
||||||
|
self, value: Optional[Union[int, str]]
|
||||||
|
) -> Optional[int]: ...
|
||||||
def contribute_to_class(
|
def contribute_to_class(
|
||||||
self, cls: Type[Model], name: str, **kwargs: Any
|
self, cls: Type[Model], name: str, **kwargs: Any
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
def formfield(self, **kwargs: Any): ...
|
def formfield(self, **kwargs: Any) -> None: ...
|
||||||
|
|
||||||
class BigAutoField(AutoField):
|
class BigAutoField(AutoField):
|
||||||
description: Any = ...
|
description: Any = ...
|
||||||
def get_internal_type(self): ...
|
def get_internal_type(self) -> str: ...
|
||||||
def rel_db_type(self, connection: Any): ...
|
def rel_db_type(self, connection: DatabaseWrapper) -> str: ...
|
||||||
|
|
||||||
class BooleanField(Field):
|
class BooleanField(Field):
|
||||||
empty_strings_allowed: bool = ...
|
empty_strings_allowed: bool = ...
|
||||||
default_error_messages: Any = ...
|
default_error_messages: Any = ...
|
||||||
description: Any = ...
|
description: Any = ...
|
||||||
def get_internal_type(self): ...
|
def get_internal_type(self) -> str: ...
|
||||||
def to_python(self, value: Any): ...
|
def to_python(self, value: Optional[Union[bool, str]]) -> bool: ...
|
||||||
def get_prep_value(self, value: Any): ...
|
def get_prep_value(
|
||||||
def formfield(self, **kwargs: Any): ...
|
self, value: Optional[Union[bool, str]]
|
||||||
|
) -> Optional[bool]: ...
|
||||||
|
def formfield(self, **kwargs: Any) -> BooleanField: ...
|
||||||
|
|
||||||
class CharField(Field):
|
class CharField(Field):
|
||||||
description: Any = ...
|
description: Any = ...
|
||||||
def __init__(self, *args: Any, **kwargs: Any) -> None: ...
|
def __init__(self, *args: Any, **kwargs: Any) -> None: ...
|
||||||
def check(self, **kwargs: Any): ...
|
def check(self, **kwargs: Any) -> List[Any]: ...
|
||||||
def cast_db_type(self, connection: Any): ...
|
def cast_db_type(self, connection: Any): ...
|
||||||
def get_internal_type(self): ...
|
def get_internal_type(self) -> str: ...
|
||||||
def to_python(self, value: Any): ...
|
def to_python(
|
||||||
def get_prep_value(self, value: Any): ...
|
self, value: Optional[Union[Model, int, str]]
|
||||||
def formfield(self, **kwargs: Any) -> URLField: ...
|
) -> Optional[str]: ...
|
||||||
|
def get_prep_value(
|
||||||
|
self, value: Optional[Union[Model, str]]
|
||||||
|
) -> Optional[str]: ...
|
||||||
|
def formfield(self, **kwargs: Any) -> Field: ...
|
||||||
|
|
||||||
class CommaSeparatedIntegerField(CharField):
|
class CommaSeparatedIntegerField(CharField):
|
||||||
default_validators: Any = ...
|
default_validators: Any = ...
|
||||||
@@ -231,7 +351,7 @@ class CommaSeparatedIntegerField(CharField):
|
|||||||
system_check_removed_details: Any = ...
|
system_check_removed_details: Any = ...
|
||||||
|
|
||||||
class DateTimeCheckMixin:
|
class DateTimeCheckMixin:
|
||||||
def check(self, **kwargs: Any): ...
|
def check(self, **kwargs: Any) -> List[Any]: ...
|
||||||
|
|
||||||
class DateField(DateTimeCheckMixin, Field):
|
class DateField(DateTimeCheckMixin, Field):
|
||||||
empty_strings_allowed: bool = ...
|
empty_strings_allowed: bool = ...
|
||||||
@@ -239,39 +359,67 @@ class DateField(DateTimeCheckMixin, Field):
|
|||||||
description: Any = ...
|
description: Any = ...
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
verbose_name: Optional[Any] = ...,
|
verbose_name: Optional[str] = ...,
|
||||||
name: Optional[Any] = ...,
|
name: None = ...,
|
||||||
auto_now: bool = ...,
|
auto_now: bool = ...,
|
||||||
auto_now_add: bool = ...,
|
auto_now_add: bool = ...,
|
||||||
**kwargs: Any
|
**kwargs: Any
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
def deconstruct(self): ...
|
def deconstruct(
|
||||||
def get_internal_type(self): ...
|
self
|
||||||
def to_python(self, value: Any): ...
|
) -> Union[
|
||||||
def pre_save(self, model_instance: Any, add: Any): ...
|
Tuple[
|
||||||
|
str,
|
||||||
|
List[Any],
|
||||||
|
Dict[str, Union[Callable, int, str]],
|
||||||
|
Dict[str, Union[Callable, int, str]],
|
||||||
|
],
|
||||||
|
Tuple[str, str, List[Any], Dict[str, int]],
|
||||||
|
]: ...
|
||||||
|
def get_internal_type(self) -> str: ...
|
||||||
|
def to_python(
|
||||||
|
self, value: Optional[Union[date, str]]
|
||||||
|
) -> Optional[date]: ...
|
||||||
|
def pre_save(
|
||||||
|
self, model_instance: Model, add: bool
|
||||||
|
) -> Optional[Union[date, CombinedExpression]]: ...
|
||||||
def contribute_to_class(
|
def contribute_to_class(
|
||||||
self, cls: Type[Model], name: str, **kwargs: Any
|
self, cls: Type[Model], name: str, **kwargs: Any
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
def get_prep_value(self, value: Any): ...
|
def get_prep_value(
|
||||||
|
self, value: Optional[Union[date, str]]
|
||||||
|
) -> Optional[date]: ...
|
||||||
def get_db_prep_value(
|
def get_db_prep_value(
|
||||||
self, value: Any, connection: Any, prepared: bool = ...
|
self,
|
||||||
): ...
|
value: Optional[date],
|
||||||
def value_to_string(self, obj: Any): ...
|
connection: DatabaseWrapper,
|
||||||
def formfield(self, **kwargs: Any): ...
|
prepared: bool = ...,
|
||||||
|
) -> Optional[str]: ...
|
||||||
|
def value_to_string(self, obj: Model) -> str: ...
|
||||||
|
def formfield(self, **kwargs: Any) -> Field: ...
|
||||||
|
|
||||||
class DateTimeField(DateField):
|
class DateTimeField(DateField):
|
||||||
empty_strings_allowed: bool = ...
|
empty_strings_allowed: bool = ...
|
||||||
default_error_messages: Any = ...
|
default_error_messages: Any = ...
|
||||||
description: Any = ...
|
description: Any = ...
|
||||||
def get_internal_type(self): ...
|
def get_internal_type(self) -> str: ...
|
||||||
def to_python(self, value: Any): ...
|
def to_python(
|
||||||
def pre_save(self, model_instance: Any, add: Any): ...
|
self, value: Optional[Union[datetime, str]]
|
||||||
def get_prep_value(self, value: Any): ...
|
) -> Optional[datetime]: ...
|
||||||
|
def pre_save(
|
||||||
|
self, model_instance: Model, add: bool
|
||||||
|
) -> Optional[Union[datetime, CombinedExpression]]: ...
|
||||||
|
def get_prep_value(
|
||||||
|
self, value: Optional[datetime]
|
||||||
|
) -> Optional[datetime]: ...
|
||||||
def get_db_prep_value(
|
def get_db_prep_value(
|
||||||
self, value: Any, connection: Any, prepared: bool = ...
|
self,
|
||||||
): ...
|
value: Optional[datetime],
|
||||||
def value_to_string(self, obj: Any): ...
|
connection: DatabaseWrapper,
|
||||||
def formfield(self, **kwargs: Any): ...
|
prepared: bool = ...,
|
||||||
|
) -> Optional[str]: ...
|
||||||
|
def value_to_string(self, obj: Model) -> str: ...
|
||||||
|
def formfield(self, **kwargs: Any) -> Field: ...
|
||||||
|
|
||||||
class DecimalField(Field):
|
class DecimalField(Field):
|
||||||
empty_strings_allowed: bool = ...
|
empty_strings_allowed: bool = ...
|
||||||
@@ -279,62 +427,64 @@ class DecimalField(Field):
|
|||||||
description: Any = ...
|
description: Any = ...
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
verbose_name: Optional[Any] = ...,
|
verbose_name: None = ...,
|
||||||
name: Optional[Any] = ...,
|
name: None = ...,
|
||||||
max_digits: Optional[Any] = ...,
|
max_digits: Optional[int] = ...,
|
||||||
decimal_places: Optional[Any] = ...,
|
decimal_places: Optional[int] = ...,
|
||||||
**kwargs: Any
|
**kwargs: Any
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
def check(self, **kwargs: Any): ...
|
def check(self, **kwargs: Any) -> List[Any]: ...
|
||||||
def validators(self): ...
|
def validators(self) -> List[DecimalValidator]: ...
|
||||||
def context(self): ...
|
def context(self) -> Context: ...
|
||||||
def deconstruct(self): ...
|
def deconstruct(
|
||||||
def get_internal_type(self): ...
|
self
|
||||||
def to_python(self, value: Any): ...
|
) -> Tuple[str, List[Any], Dict[str, int], Dict[str, int]]: ...
|
||||||
def get_db_prep_save(self, value: Any, connection: Any): ...
|
def get_internal_type(self) -> str: ...
|
||||||
def get_prep_value(self, value: Any): ...
|
def to_python(self, value: Optional[str]) -> Optional[Decimal]: ...
|
||||||
def formfield(self, **kwargs: Any) -> DecimalField: ...
|
def get_db_prep_save(
|
||||||
|
self, value: Optional[str], connection: DatabaseWrapper
|
||||||
|
) -> Optional[str]: ...
|
||||||
|
def get_prep_value(self, value: None) -> None: ...
|
||||||
|
def formfield(self, **kwargs: Any): ...
|
||||||
|
|
||||||
class DurationField(Field):
|
class DurationField(Field):
|
||||||
empty_strings_allowed: bool = ...
|
empty_strings_allowed: bool = ...
|
||||||
default_error_messages: Any = ...
|
default_error_messages: Any = ...
|
||||||
description: Any = ...
|
description: Any = ...
|
||||||
def get_internal_type(self): ...
|
def get_internal_type(self) -> str: ...
|
||||||
def to_python(self, value: Any): ...
|
def to_python(self, value: str) -> timedelta: ...
|
||||||
def get_db_prep_value(
|
def get_db_prep_value(
|
||||||
self, value: Any, connection: Any, prepared: bool = ...
|
self, value: Any, connection: Any, prepared: bool = ...
|
||||||
): ...
|
): ...
|
||||||
def get_db_converters(self, connection: Any): ...
|
def get_db_converters(self, connection: Any): ...
|
||||||
def value_to_string(self, obj: Any): ...
|
def value_to_string(self, obj: Model) -> str: ...
|
||||||
def formfield(self, **kwargs: Any): ...
|
def formfield(self, **kwargs: Any) -> DurationField: ...
|
||||||
|
|
||||||
class EmailField(CharField):
|
class EmailField(CharField):
|
||||||
default_validators: Any = ...
|
default_validators: Any = ...
|
||||||
description: Any = ...
|
description: Any = ...
|
||||||
def __init__(self, *args: Any, **kwargs: Any) -> None: ...
|
def __init__(self, *args: Any, **kwargs: Any) -> None: ...
|
||||||
def deconstruct(self): ...
|
def deconstruct(
|
||||||
def formfield(self, **kwargs: Any): ...
|
self
|
||||||
|
) -> Tuple[str, List[Any], Dict[str, int], Dict[str, int]]: ...
|
||||||
|
def formfield(self, **kwargs: Any) -> EmailField: ...
|
||||||
|
|
||||||
class FilePathField(Field):
|
class FilePathField(Field):
|
||||||
description: Any = ...
|
description: Any = ...
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
verbose_name: None = ...,
|
verbose_name: Optional[Any] = ...,
|
||||||
name: None = ...,
|
name: Optional[Any] = ...,
|
||||||
path: str = ...,
|
path: str = ...,
|
||||||
match: str = ...,
|
match: Optional[Any] = ...,
|
||||||
recursive: bool = ...,
|
recursive: bool = ...,
|
||||||
allow_files: bool = ...,
|
allow_files: bool = ...,
|
||||||
allow_folders: bool = ...,
|
allow_folders: bool = ...,
|
||||||
**kwargs: Any
|
**kwargs: Any
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
def check(self, **kwargs: Any): ...
|
def check(self, **kwargs: Any): ...
|
||||||
def deconstruct(
|
def deconstruct(self): ...
|
||||||
self
|
def get_prep_value(self, value: Optional[str]) -> Optional[str]: ...
|
||||||
) -> Tuple[
|
|
||||||
str, List[Any], Dict[str, Union[str, bool]], Dict[str, Union[str, bool]]
|
|
||||||
]: ...
|
|
||||||
def get_prep_value(self, value: Any): ...
|
|
||||||
def formfield(self, **kwargs: Any): ...
|
def formfield(self, **kwargs: Any): ...
|
||||||
def get_internal_type(self): ...
|
def get_internal_type(self): ...
|
||||||
|
|
||||||
@@ -342,37 +492,39 @@ class FloatField(Field):
|
|||||||
empty_strings_allowed: bool = ...
|
empty_strings_allowed: bool = ...
|
||||||
default_error_messages: Any = ...
|
default_error_messages: Any = ...
|
||||||
description: Any = ...
|
description: Any = ...
|
||||||
def get_prep_value(self, value: Any): ...
|
def get_prep_value(self, value: Union[float, str]) -> float: ...
|
||||||
def get_internal_type(self): ...
|
def get_internal_type(self) -> str: ...
|
||||||
def to_python(self, value: Any): ...
|
def to_python(self, value: Union[float, str]) -> float: ...
|
||||||
def formfield(self, **kwargs: Any): ...
|
def formfield(self, **kwargs: Any) -> FloatField: ...
|
||||||
|
|
||||||
class IntegerField(Field):
|
class IntegerField(Field):
|
||||||
empty_strings_allowed: bool = ...
|
empty_strings_allowed: bool = ...
|
||||||
default_error_messages: Any = ...
|
default_error_messages: Any = ...
|
||||||
description: Any = ...
|
description: Any = ...
|
||||||
def check(self, **kwargs: Any): ...
|
def check(self, **kwargs: Any) -> List[Any]: ...
|
||||||
def validators(self): ...
|
def validators(self) -> List[Any]: ...
|
||||||
def get_prep_value(self, value: Any): ...
|
def get_prep_value(
|
||||||
def get_internal_type(self): ...
|
self, value: Optional[Union[int, str]]
|
||||||
def to_python(self, value: Any): ...
|
) -> Optional[int]: ...
|
||||||
|
def get_internal_type(self) -> str: ...
|
||||||
|
def to_python(self, value: Union[int, str]) -> int: ...
|
||||||
def formfield(self, **kwargs: Any) -> Field: ...
|
def formfield(self, **kwargs: Any) -> Field: ...
|
||||||
|
|
||||||
class BigIntegerField(IntegerField):
|
class BigIntegerField(IntegerField):
|
||||||
empty_strings_allowed: bool = ...
|
empty_strings_allowed: bool = ...
|
||||||
description: Any = ...
|
description: Any = ...
|
||||||
MAX_BIGINT: int = ...
|
MAX_BIGINT: int = ...
|
||||||
def get_internal_type(self): ...
|
def get_internal_type(self) -> str: ...
|
||||||
def formfield(self, **kwargs: Any) -> IntegerField: ...
|
def formfield(self, **kwargs: Any): ...
|
||||||
|
|
||||||
class IPAddressField(Field):
|
class IPAddressField(Field):
|
||||||
empty_strings_allowed: bool = ...
|
empty_strings_allowed: bool = ...
|
||||||
description: Any = ...
|
description: Any = ...
|
||||||
system_check_removed_details: Any = ...
|
system_check_removed_details: Any = ...
|
||||||
def __init__(self, *args: Any, **kwargs: Any) -> None: ...
|
def __init__(self, *args: Any, **kwargs: Any) -> None: ...
|
||||||
def deconstruct(self): ...
|
def deconstruct(self) -> Tuple[None, str, List[Any], Dict[str, bool]]: ...
|
||||||
def get_prep_value(self, value: Any): ...
|
def get_prep_value(self, value: Any): ...
|
||||||
def get_internal_type(self): ...
|
def get_internal_type(self) -> str: ...
|
||||||
|
|
||||||
class GenericIPAddressField(Field):
|
class GenericIPAddressField(Field):
|
||||||
empty_strings_allowed: bool = ...
|
empty_strings_allowed: bool = ...
|
||||||
@@ -392,12 +544,15 @@ class GenericIPAddressField(Field):
|
|||||||
def check(self, **kwargs: Any): ...
|
def check(self, **kwargs: Any): ...
|
||||||
def deconstruct(self): ...
|
def deconstruct(self): ...
|
||||||
def get_internal_type(self): ...
|
def get_internal_type(self): ...
|
||||||
def to_python(self, value: Any): ...
|
def to_python(self, value: Union[Callable, int, str]) -> str: ...
|
||||||
def get_db_prep_value(
|
def get_db_prep_value(
|
||||||
self, value: Any, connection: Any, prepared: bool = ...
|
self,
|
||||||
): ...
|
value: Optional[str],
|
||||||
def get_prep_value(self, value: Any): ...
|
connection: DatabaseWrapper,
|
||||||
def formfield(self, **kwargs: Any): ...
|
prepared: bool = ...,
|
||||||
|
) -> Optional[str]: ...
|
||||||
|
def get_prep_value(self, value: Optional[str]) -> Optional[str]: ...
|
||||||
|
def formfield(self, **kwargs: Any) -> GenericIPAddressField: ...
|
||||||
|
|
||||||
class NullBooleanField(BooleanField):
|
class NullBooleanField(BooleanField):
|
||||||
default_error_messages: Any = ...
|
default_error_messages: Any = ...
|
||||||
@@ -411,12 +566,12 @@ class PositiveIntegerRelDbTypeMixin:
|
|||||||
|
|
||||||
class PositiveIntegerField(PositiveIntegerRelDbTypeMixin, IntegerField):
|
class PositiveIntegerField(PositiveIntegerRelDbTypeMixin, IntegerField):
|
||||||
description: Any = ...
|
description: Any = ...
|
||||||
def get_internal_type(self): ...
|
def get_internal_type(self) -> str: ...
|
||||||
def formfield(self, **kwargs: Any) -> TypedChoiceField: ...
|
def formfield(self, **kwargs: Any) -> IntegerField: ...
|
||||||
|
|
||||||
class PositiveSmallIntegerField(PositiveIntegerRelDbTypeMixin, IntegerField):
|
class PositiveSmallIntegerField(PositiveIntegerRelDbTypeMixin, IntegerField):
|
||||||
description: Any = ...
|
description: Any = ...
|
||||||
def get_internal_type(self): ...
|
def get_internal_type(self) -> str: ...
|
||||||
def formfield(self, **kwargs: Any): ...
|
def formfield(self, **kwargs: Any): ...
|
||||||
|
|
||||||
class SlugField(CharField):
|
class SlugField(CharField):
|
||||||
@@ -431,20 +586,34 @@ class SlugField(CharField):
|
|||||||
allow_unicode: bool = ...,
|
allow_unicode: bool = ...,
|
||||||
**kwargs: Any
|
**kwargs: Any
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
def deconstruct(self): ...
|
def deconstruct(
|
||||||
def get_internal_type(self): ...
|
self
|
||||||
def formfield(self, **kwargs: Any): ...
|
) -> Union[
|
||||||
|
Tuple[
|
||||||
|
str,
|
||||||
|
List[Any],
|
||||||
|
Dict[str, int],
|
||||||
|
Union[Dict[Any, Any], Dict[str, int]],
|
||||||
|
],
|
||||||
|
Tuple[str, str, List[Any], Dict[str, int]],
|
||||||
|
]: ...
|
||||||
|
def get_internal_type(self) -> str: ...
|
||||||
|
def formfield(self, **kwargs: Any) -> SlugField: ...
|
||||||
|
|
||||||
class SmallIntegerField(IntegerField):
|
class SmallIntegerField(IntegerField):
|
||||||
description: Any = ...
|
description: Any = ...
|
||||||
def get_internal_type(self): ...
|
def get_internal_type(self) -> str: ...
|
||||||
|
|
||||||
class TextField(Field):
|
class TextField(Field):
|
||||||
description: Any = ...
|
description: Any = ...
|
||||||
def get_internal_type(self): ...
|
def get_internal_type(self) -> str: ...
|
||||||
def to_python(self, value: Any): ...
|
def to_python(
|
||||||
def get_prep_value(self, value: Any): ...
|
self, value: Optional[Union[Dict[Any, Any], int, str]]
|
||||||
def formfield(self, **kwargs: Any): ...
|
) -> Optional[str]: ...
|
||||||
|
def get_prep_value(
|
||||||
|
self, value: Optional[Union[Dict[Any, Any], int, str]]
|
||||||
|
) -> Optional[str]: ...
|
||||||
|
def formfield(self, **kwargs: Any) -> Field: ...
|
||||||
|
|
||||||
class TimeField(DateTimeCheckMixin, Field):
|
class TimeField(DateTimeCheckMixin, Field):
|
||||||
empty_strings_allowed: bool = ...
|
empty_strings_allowed: bool = ...
|
||||||
@@ -452,20 +621,31 @@ class TimeField(DateTimeCheckMixin, Field):
|
|||||||
description: Any = ...
|
description: Any = ...
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
verbose_name: Optional[Any] = ...,
|
verbose_name: None = ...,
|
||||||
name: Optional[Any] = ...,
|
name: None = ...,
|
||||||
auto_now: bool = ...,
|
auto_now: bool = ...,
|
||||||
auto_now_add: bool = ...,
|
auto_now_add: bool = ...,
|
||||||
**kwargs: Any
|
**kwargs: Any
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
def deconstruct(self): ...
|
def deconstruct(
|
||||||
def get_internal_type(self): ...
|
self
|
||||||
def to_python(self, value: Any): ...
|
) -> Tuple[str, List[Any], Dict[Any, Any], Dict[Any, Any]]: ...
|
||||||
def pre_save(self, model_instance: Any, add: Any): ...
|
def get_internal_type(self) -> str: ...
|
||||||
def get_prep_value(self, value: Any): ...
|
def to_python(
|
||||||
|
self, value: Optional[Union[datetime, time, str]]
|
||||||
|
) -> Optional[time]: ...
|
||||||
|
def pre_save(
|
||||||
|
self, model_instance: Model, add: bool
|
||||||
|
) -> Optional[datetime]: ...
|
||||||
|
def get_prep_value(
|
||||||
|
self, value: Optional[Union[datetime, time]]
|
||||||
|
) -> Optional[time]: ...
|
||||||
def get_db_prep_value(
|
def get_db_prep_value(
|
||||||
self, value: Any, connection: Any, prepared: bool = ...
|
self,
|
||||||
): ...
|
value: Optional[Union[datetime, time]],
|
||||||
|
connection: DatabaseWrapper,
|
||||||
|
prepared: bool = ...,
|
||||||
|
) -> Optional[str]: ...
|
||||||
def value_to_string(self, obj: Any): ...
|
def value_to_string(self, obj: Any): ...
|
||||||
def formfield(self, **kwargs: Any): ...
|
def formfield(self, **kwargs: Any): ...
|
||||||
|
|
||||||
@@ -473,25 +653,44 @@ class URLField(CharField):
|
|||||||
default_validators: Any = ...
|
default_validators: Any = ...
|
||||||
description: Any = ...
|
description: Any = ...
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self, verbose_name: None = ..., name: None = ..., **kwargs: Any
|
||||||
verbose_name: Optional[Any] = ...,
|
|
||||||
name: Optional[Any] = ...,
|
|
||||||
**kwargs: Any
|
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
def deconstruct(self): ...
|
def deconstruct(
|
||||||
def formfield(self, **kwargs: Any): ...
|
self
|
||||||
|
) -> Tuple[
|
||||||
|
str, List[Any], Dict[str, int], Union[Dict[Any, Any], Dict[str, int]]
|
||||||
|
]: ...
|
||||||
|
def formfield(self, **kwargs: Any) -> URLField: ...
|
||||||
|
|
||||||
class BinaryField(Field):
|
class BinaryField(Field):
|
||||||
description: Any = ...
|
description: Any = ...
|
||||||
empty_values: Any = ...
|
empty_values: Any = ...
|
||||||
def __init__(self, *args: Any, **kwargs: Any) -> None: ...
|
def __init__(self, *args: Any, **kwargs: Any) -> None: ...
|
||||||
def deconstruct(self): ...
|
def deconstruct(
|
||||||
def get_internal_type(self): ...
|
self
|
||||||
def get_placeholder(self, value: Any, compiler: Any, connection: Any): ...
|
) -> Union[
|
||||||
def get_default(self): ...
|
Tuple[
|
||||||
|
str,
|
||||||
|
List[Any],
|
||||||
|
Dict[str, bool],
|
||||||
|
Union[Dict[Any, Any], Dict[str, bool]],
|
||||||
|
],
|
||||||
|
Tuple[str, str, List[Any], Dict[Any, Any]],
|
||||||
|
]: ...
|
||||||
|
def get_internal_type(self) -> str: ...
|
||||||
|
def get_placeholder(
|
||||||
|
self,
|
||||||
|
value: Optional[memoryview],
|
||||||
|
compiler: SQLInsertCompiler,
|
||||||
|
connection: DatabaseWrapper,
|
||||||
|
) -> str: ...
|
||||||
|
def get_default(self) -> bytes: ...
|
||||||
def get_db_prep_value(
|
def get_db_prep_value(
|
||||||
self, value: Any, connection: Any, prepared: bool = ...
|
self,
|
||||||
): ...
|
value: Optional[bytes],
|
||||||
|
connection: DatabaseWrapper,
|
||||||
|
prepared: bool = ...,
|
||||||
|
) -> Optional[memoryview]: ...
|
||||||
def value_to_string(self, obj: Any): ...
|
def value_to_string(self, obj: Any): ...
|
||||||
def to_python(self, value: Any): ...
|
def to_python(self, value: Any): ...
|
||||||
|
|
||||||
@@ -499,13 +698,23 @@ class UUIDField(Field):
|
|||||||
default_error_messages: Any = ...
|
default_error_messages: Any = ...
|
||||||
description: str = ...
|
description: str = ...
|
||||||
empty_strings_allowed: bool = ...
|
empty_strings_allowed: bool = ...
|
||||||
def __init__(
|
def __init__(self, verbose_name: None = ..., **kwargs: Any) -> None: ...
|
||||||
self, verbose_name: Optional[Any] = ..., **kwargs: Any
|
def deconstruct(
|
||||||
) -> None: ...
|
self
|
||||||
def deconstruct(self): ...
|
) -> Tuple[
|
||||||
def get_internal_type(self): ...
|
str,
|
||||||
|
List[Any],
|
||||||
|
Dict[str, Union[Callable, bool]],
|
||||||
|
Dict[str, Union[Callable, bool]],
|
||||||
|
]: ...
|
||||||
|
def get_internal_type(self) -> str: ...
|
||||||
def get_db_prep_value(
|
def get_db_prep_value(
|
||||||
self, value: Any, connection: Any, prepared: bool = ...
|
self,
|
||||||
): ...
|
value: Optional[Union[Dict[Any, Any], List[Any]]],
|
||||||
def to_python(self, value: Any): ...
|
connection: DatabaseWrapper,
|
||||||
def formfield(self, **kwargs: Any): ...
|
prepared: bool = ...,
|
||||||
|
) -> None: ...
|
||||||
|
def to_python(
|
||||||
|
self, value: Optional[Union[Dict[Any, Any], List[Any], UUID]]
|
||||||
|
) -> Optional[UUID]: ...
|
||||||
|
def formfield(self, **kwargs: Any) -> UUIDField: ...
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
from functools import partial
|
|
||||||
from typing import Any, Callable, Dict, List, Optional, Tuple, Type, Union
|
from typing import Any, Callable, Dict, List, Optional, Tuple, Type, Union
|
||||||
|
|
||||||
from django.core.checks.messages import Error
|
from django.core.checks.messages import Error
|
||||||
@@ -20,12 +19,7 @@ class FieldFile(File):
|
|||||||
def __init__(
|
def __init__(
|
||||||
self, instance: Model, field: FileField, name: Optional[str]
|
self, instance: Model, field: FileField, name: Optional[str]
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
def __eq__(
|
def __eq__(self, other: Any) -> bool: ...
|
||||||
self,
|
|
||||||
other: Optional[
|
|
||||||
Union[Dict[Any, Any], List[Any], Tuple, FieldFile, str]
|
|
||||||
],
|
|
||||||
) -> bool: ...
|
|
||||||
def __hash__(self): ...
|
def __hash__(self): ...
|
||||||
file: Any = ...
|
file: Any = ...
|
||||||
@property
|
@property
|
||||||
@@ -69,36 +63,16 @@ class FileField(Field):
|
|||||||
def check(self, **kwargs: Any) -> List[Error]: ...
|
def check(self, **kwargs: Any) -> List[Error]: ...
|
||||||
def deconstruct(
|
def deconstruct(
|
||||||
self
|
self
|
||||||
) -> Union[
|
) -> Tuple[
|
||||||
Tuple[
|
str,
|
||||||
None,
|
List[Any],
|
||||||
str,
|
Union[
|
||||||
List[Any],
|
Dict[str, Union[Callable, FileSystemStorage, int]],
|
||||||
Union[
|
Dict[str, Union[FileSystemStorage, int, str]],
|
||||||
Dict[str, Union[Callable, FileSystemStorage]],
|
|
||||||
Dict[str, Union[partial, int]],
|
|
||||||
],
|
|
||||||
],
|
],
|
||||||
Tuple[
|
Union[
|
||||||
str,
|
Dict[str, Union[Callable, FileSystemStorage, int]],
|
||||||
List[Any],
|
Dict[str, Union[FileSystemStorage, int, str]],
|
||||||
Union[
|
|
||||||
Dict[str, Union[Callable, FileSystemStorage, int]],
|
|
||||||
Dict[str, Union[FileSystemStorage, int, str]],
|
|
||||||
],
|
|
||||||
Union[
|
|
||||||
Dict[str, Union[Callable, FileSystemStorage, int]],
|
|
||||||
Dict[str, Union[FileSystemStorage, int, str]],
|
|
||||||
],
|
|
||||||
],
|
|
||||||
Tuple[
|
|
||||||
str,
|
|
||||||
str,
|
|
||||||
List[Any],
|
|
||||||
Union[
|
|
||||||
Dict[str, Union[Callable, bool, FileSystemStorage]],
|
|
||||||
Dict[str, str],
|
|
||||||
],
|
|
||||||
],
|
],
|
||||||
]: ...
|
]: ...
|
||||||
def get_internal_type(self) -> str: ...
|
def get_internal_type(self) -> str: ...
|
||||||
@@ -141,16 +115,11 @@ class ImageField(FileField):
|
|||||||
def check(self, **kwargs: Any) -> List[Any]: ...
|
def check(self, **kwargs: Any) -> List[Any]: ...
|
||||||
def deconstruct(
|
def deconstruct(
|
||||||
self
|
self
|
||||||
) -> Union[
|
) -> Tuple[
|
||||||
Tuple[
|
str,
|
||||||
str,
|
List[Any],
|
||||||
List[Any],
|
Dict[str, Union[Callable, bool, FileSystemStorage, str]],
|
||||||
Dict[str, Union[Callable, bool, FileSystemStorage, str]],
|
Dict[str, Union[Callable, bool, FileSystemStorage, str]],
|
||||||
Dict[str, Union[Callable, bool, FileSystemStorage, str]],
|
|
||||||
],
|
|
||||||
Tuple[
|
|
||||||
str, str, List[Any], Dict[str, Union[Callable, FileSystemStorage]]
|
|
||||||
],
|
|
||||||
]: ...
|
]: ...
|
||||||
def contribute_to_class(
|
def contribute_to_class(
|
||||||
self, cls: Type[Model], name: str, **kwargs: Any
|
self, cls: Type[Model], name: str, **kwargs: Any
|
||||||
|
|||||||
@@ -3,19 +3,13 @@ from uuid import UUID
|
|||||||
|
|
||||||
from django.core.checks.messages import Error, Warning
|
from django.core.checks.messages import Error, Warning
|
||||||
from django.db.backends.sqlite3.base import DatabaseWrapper
|
from django.db.backends.sqlite3.base import DatabaseWrapper
|
||||||
|
from django.db.migrations.writer import SettingsReference
|
||||||
from django.db.models.base import Model
|
from django.db.models.base import Model
|
||||||
from django.db.models.expressions import Col
|
from django.db.models.expressions import Col
|
||||||
from django.db.models.fields import Field
|
from django.db.models.fields import Field
|
||||||
from django.db.models.fields.mixins import FieldCacheMixin
|
|
||||||
from django.db.models.fields.related_lookups import (RelatedGreaterThan,
|
|
||||||
RelatedGreaterThanOrEqual,
|
|
||||||
RelatedIn, RelatedIsNull,
|
|
||||||
RelatedLessThan,
|
|
||||||
RelatedLessThanOrEqual)
|
|
||||||
from django.db.models.fields.reverse_related import (ForeignObjectRel,
|
from django.db.models.fields.reverse_related import (ForeignObjectRel,
|
||||||
ManyToManyRel,
|
ManyToManyRel,
|
||||||
ManyToOneRel)
|
ManyToOneRel, OneToOneRel)
|
||||||
from django.db.models.lookups import Exact
|
|
||||||
from django.db.models.query import QuerySet
|
from django.db.models.query import QuerySet
|
||||||
from django.db.models.query_utils import PathInfo, Q
|
from django.db.models.query_utils import PathInfo, Q
|
||||||
from django.db.models.sql.where import WhereNode
|
from django.db.models.sql.where import WhereNode
|
||||||
@@ -63,27 +57,18 @@ class RelatedField(FieldCacheMixin, Field):
|
|||||||
) -> None: ...
|
) -> None: ...
|
||||||
def deconstruct(
|
def deconstruct(
|
||||||
self
|
self
|
||||||
) -> Union[
|
) -> Tuple[
|
||||||
Tuple[
|
str,
|
||||||
str,
|
List[Any],
|
||||||
List[Any],
|
Union[
|
||||||
|
Dict[str, Union[Callable, bool, str]],
|
||||||
Dict[str, Union[Dict[str, Union[int, str]], bool]],
|
Dict[str, Union[Dict[str, Union[int, str]], bool]],
|
||||||
|
Dict[str, Union[Dict[str, bool], bool, str]],
|
||||||
|
],
|
||||||
|
Union[
|
||||||
|
Dict[str, Union[Callable, bool, str]],
|
||||||
Dict[str, Union[Dict[str, Union[int, str]], bool]],
|
Dict[str, Union[Dict[str, Union[int, str]], bool]],
|
||||||
],
|
Dict[str, Union[Dict[str, bool], bool, str]],
|
||||||
Tuple[
|
|
||||||
str,
|
|
||||||
List[Any],
|
|
||||||
Union[
|
|
||||||
Dict[str, Union[Callable, bool, str]],
|
|
||||||
Dict[str, Union[Dict[str, bool], bool, str]],
|
|
||||||
],
|
|
||||||
Union[
|
|
||||||
Dict[str, Union[Callable, bool, str]],
|
|
||||||
Dict[str, Union[Dict[str, bool], bool, str]],
|
|
||||||
],
|
|
||||||
],
|
|
||||||
Tuple[
|
|
||||||
str, str, List[Any], Dict[str, Union[Dict[str, bool], bool, str]]
|
|
||||||
],
|
],
|
||||||
]: ...
|
]: ...
|
||||||
def get_forward_related_filter(
|
def get_forward_related_filter(
|
||||||
@@ -135,40 +120,19 @@ class ForeignObject(RelatedField):
|
|||||||
def deconstruct(
|
def deconstruct(
|
||||||
self
|
self
|
||||||
) -> Union[
|
) -> Union[
|
||||||
|
Tuple[None, str, List[Any], Dict[str, Any]],
|
||||||
|
Tuple[str, List[Any], Dict[str, Any], Dict[str, Any]],
|
||||||
Tuple[
|
Tuple[
|
||||||
None,
|
str,
|
||||||
str,
|
str,
|
||||||
List[Any],
|
List[Any],
|
||||||
Dict[
|
Dict[
|
||||||
str,
|
str,
|
||||||
Union[
|
Union[
|
||||||
Callable,
|
Callable, Dict[str, Union[int, str]], List[str], bool, str
|
||||||
Dict[str, Union[int, str]],
|
|
||||||
List[None],
|
|
||||||
List[str],
|
|
||||||
bool,
|
|
||||||
str,
|
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
Tuple[
|
|
||||||
str,
|
|
||||||
str,
|
|
||||||
List[Any],
|
|
||||||
Union[
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
Callable,
|
|
||||||
Dict[str, Union[int, str]],
|
|
||||||
List[str],
|
|
||||||
bool,
|
|
||||||
str,
|
|
||||||
],
|
|
||||||
],
|
|
||||||
Dict[str, Union[Callable, List[None], List[str], bool, str]],
|
|
||||||
],
|
|
||||||
],
|
|
||||||
]: ...
|
]: ...
|
||||||
def resolve_related_fields(self) -> List[Tuple[Field, Field]]: ...
|
def resolve_related_fields(self) -> List[Tuple[Field, Field]]: ...
|
||||||
@property
|
@property
|
||||||
@@ -205,22 +169,7 @@ class ForeignObject(RelatedField):
|
|||||||
) -> List[PathInfo]: ...
|
) -> List[PathInfo]: ...
|
||||||
def get_reverse_path_info(self, filtered_relation: Optional[Any] = ...): ...
|
def get_reverse_path_info(self, filtered_relation: Optional[Any] = ...): ...
|
||||||
@classmethod
|
@classmethod
|
||||||
def get_lookups(
|
def get_lookups(cls) -> Dict[str, Type[Any]]: ...
|
||||||
cls
|
|
||||||
) -> Dict[
|
|
||||||
str,
|
|
||||||
Type[
|
|
||||||
Union[
|
|
||||||
RelatedGreaterThan,
|
|
||||||
RelatedGreaterThanOrEqual,
|
|
||||||
RelatedIn,
|
|
||||||
RelatedIsNull,
|
|
||||||
RelatedLessThan,
|
|
||||||
RelatedLessThanOrEqual,
|
|
||||||
Exact,
|
|
||||||
]
|
|
||||||
],
|
|
||||||
]: ...
|
|
||||||
def contribute_to_class(
|
def contribute_to_class(
|
||||||
self,
|
self,
|
||||||
cls: Type[Model],
|
cls: Type[Model],
|
||||||
@@ -261,23 +210,31 @@ class ForeignKey(ForeignObject):
|
|||||||
self
|
self
|
||||||
) -> Union[
|
) -> Union[
|
||||||
Tuple[
|
Tuple[
|
||||||
|
None,
|
||||||
str,
|
str,
|
||||||
List[Any],
|
List[Any],
|
||||||
Dict[str, Union[Callable, Dict[str, Union[int, str]], str]],
|
Dict[str, Union[Callable, Dict[str, Union[int, str]], str]],
|
||||||
Dict[str, Union[Callable, Dict[str, Union[int, str]], str]],
|
|
||||||
],
|
],
|
||||||
Tuple[
|
Tuple[
|
||||||
str,
|
str,
|
||||||
List[Any],
|
List[Any],
|
||||||
Union[
|
Union[
|
||||||
|
Dict[str, Union[Callable, Dict[str, Union[int, str]], str]],
|
||||||
Dict[str, Union[Callable, Dict[str, bool], str]],
|
Dict[str, Union[Callable, Dict[str, bool], str]],
|
||||||
Dict[str, Union[Callable, bool, str]],
|
Dict[str, Union[Callable, bool, str]],
|
||||||
],
|
],
|
||||||
Union[
|
Union[
|
||||||
|
Dict[str, Union[Callable, Dict[str, Union[int, str]], str]],
|
||||||
Dict[str, Union[Callable, Dict[str, bool], str]],
|
Dict[str, Union[Callable, Dict[str, bool], str]],
|
||||||
Dict[str, Union[Callable, bool, str]],
|
Dict[str, Union[Callable, bool, str]],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
|
Tuple[
|
||||||
|
str,
|
||||||
|
str,
|
||||||
|
List[Any],
|
||||||
|
Dict[str, Union[Callable, bool, SettingsReference]],
|
||||||
|
],
|
||||||
]: ...
|
]: ...
|
||||||
def to_python(self, value: Union[int, str]) -> int: ...
|
def to_python(self, value: Union[int, str]) -> int: ...
|
||||||
@property
|
@property
|
||||||
@@ -320,7 +277,7 @@ class ForeignKey(ForeignObject):
|
|||||||
def get_col(
|
def get_col(
|
||||||
self,
|
self,
|
||||||
alias: str,
|
alias: str,
|
||||||
output_field: Optional[Union[Field, mixins.FieldCacheMixin]] = ...,
|
output_field: Optional[Union[Field, OneToOneRel]] = ...,
|
||||||
) -> Col: ...
|
) -> Col: ...
|
||||||
|
|
||||||
class OneToOneField(ForeignKey):
|
class OneToOneField(ForeignKey):
|
||||||
@@ -341,14 +298,11 @@ class OneToOneField(ForeignKey):
|
|||||||
) -> None: ...
|
) -> None: ...
|
||||||
def deconstruct(
|
def deconstruct(
|
||||||
self
|
self
|
||||||
) -> Union[
|
) -> Tuple[
|
||||||
Tuple[
|
str,
|
||||||
str,
|
List[Any],
|
||||||
List[Any],
|
Dict[str, Union[Callable, bool, str]],
|
||||||
Dict[str, Union[Callable, bool, str]],
|
Dict[str, Union[Callable, bool, str]],
|
||||||
Dict[str, Union[Callable, bool, str]],
|
|
||||||
],
|
|
||||||
Tuple[str, str, List[Any], Dict[str, Union[Callable, str]]],
|
|
||||||
]: ...
|
]: ...
|
||||||
def formfield(self, **kwargs: Any) -> None: ...
|
def formfield(self, **kwargs: Any) -> None: ...
|
||||||
def save_form_data(
|
def save_form_data(
|
||||||
@@ -385,18 +339,18 @@ class ManyToManyField(RelatedField):
|
|||||||
def deconstruct(
|
def deconstruct(
|
||||||
self
|
self
|
||||||
) -> Union[
|
) -> Union[
|
||||||
|
Tuple[None, str, List[Any], Dict[str, Union[bool, str]]],
|
||||||
Tuple[
|
Tuple[
|
||||||
str,
|
str,
|
||||||
List[Any],
|
List[Any],
|
||||||
Dict[str, Union[Callable, str]],
|
Union[Dict[str, Union[Callable, str]], Dict[str, Union[bool, str]]],
|
||||||
Dict[str, Union[Callable, str]],
|
Union[
|
||||||
],
|
Dict[str, Union[Callable, str]],
|
||||||
Tuple[
|
Dict[str, Union[bool, str]],
|
||||||
str,
|
Dict[str, str],
|
||||||
List[Any],
|
],
|
||||||
Dict[str, Union[bool, str]],
|
|
||||||
Dict[str, Union[bool, str]],
|
|
||||||
],
|
],
|
||||||
|
Tuple[str, str, List[Any], Dict[str, Union[Callable, str]]],
|
||||||
]: ...
|
]: ...
|
||||||
def get_path_info(
|
def get_path_info(
|
||||||
self, filtered_relation: None = ...
|
self, filtered_relation: None = ...
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ from uuid import UUID
|
|||||||
|
|
||||||
from django.db.backends.sqlite3.base import DatabaseWrapper
|
from django.db.backends.sqlite3.base import DatabaseWrapper
|
||||||
from django.db.models.base import Model
|
from django.db.models.base import Model
|
||||||
from django.db.models.expressions import Col, Combinable, OuterRef
|
from django.db.models.expressions import Col, OuterRef
|
||||||
from django.db.models.fields import Field
|
from django.db.models.fields import Field
|
||||||
from django.db.models.fields.related import ForeignObject
|
from django.db.models.fields.related import ForeignObject
|
||||||
from django.db.models.lookups import (Exact, GreaterThan, GreaterThanOrEqual,
|
from django.db.models.lookups import (Exact, GreaterThan, GreaterThanOrEqual,
|
||||||
@@ -33,10 +33,7 @@ class MultiColSource:
|
|||||||
) -> Type[Union[RelatedExact, RelatedIn, RelatedIsNull]]: ...
|
) -> Type[Union[RelatedExact, RelatedIn, RelatedIsNull]]: ...
|
||||||
|
|
||||||
def get_normalized_value(
|
def get_normalized_value(
|
||||||
value: Optional[
|
value: Any, lhs: Union[Col, MultiColSource]
|
||||||
Union[Tuple[Union[int, str]], Model, OuterRef, int, str, UUID]
|
|
||||||
],
|
|
||||||
lhs: Union[Col, MultiColSource],
|
|
||||||
) -> Tuple[Optional[Union[OuterRef, int, str, UUID]]]: ...
|
) -> Tuple[Optional[Union[OuterRef, int, str, UUID]]]: ...
|
||||||
|
|
||||||
class RelatedIn(In):
|
class RelatedIn(In):
|
||||||
@@ -65,9 +62,7 @@ class RelatedIn(In):
|
|||||||
|
|
||||||
class RelatedLookupMixin:
|
class RelatedLookupMixin:
|
||||||
rhs: Any = ...
|
rhs: Any = ...
|
||||||
def get_prep_lookup(
|
def get_prep_lookup(self) -> Any: ...
|
||||||
self
|
|
||||||
) -> Optional[Union[Model, Combinable, Query, int, str, UUID]]: ...
|
|
||||||
def as_sql(
|
def as_sql(
|
||||||
self, compiler: SQLCompiler, connection: DatabaseWrapper
|
self, compiler: SQLCompiler, connection: DatabaseWrapper
|
||||||
) -> Tuple[str, List[Union[int, str]]]: ...
|
) -> Tuple[str, List[Union[int, str]]]: ...
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ from typing import Any, List, Optional, Set, Tuple, Union
|
|||||||
from django.db.backends.sqlite3.base import DatabaseWrapper
|
from django.db.backends.sqlite3.base import DatabaseWrapper
|
||||||
from django.db.models import Func, Transform
|
from django.db.models import Func, Transform
|
||||||
from django.db.models.expressions import Col, Expression
|
from django.db.models.expressions import Col, Expression
|
||||||
from django.db.models.fields import Field
|
from django.db.models.fields import DateTimeCheckMixin, IntegerField
|
||||||
from django.db.models.sql.compiler import SQLCompiler
|
from django.db.models.sql.compiler import SQLCompiler
|
||||||
from django.db.models.sql.query import Query
|
from django.db.models.sql.query import Query
|
||||||
|
|
||||||
@@ -138,7 +138,7 @@ class TruncBase(TimezoneMixin, Transform):
|
|||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
expression: Union[Col, str],
|
expression: Union[Col, str],
|
||||||
output_field: Optional[Field] = ...,
|
output_field: Optional[Union[DateTimeCheckMixin, IntegerField]] = ...,
|
||||||
tzinfo: None = ...,
|
tzinfo: None = ...,
|
||||||
**extra: Any
|
**extra: Any
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
@@ -164,10 +164,7 @@ class Trunc(TruncBase):
|
|||||||
contains_aggregate: bool
|
contains_aggregate: bool
|
||||||
extra: Dict[Any, Any]
|
extra: Dict[Any, Any]
|
||||||
is_summary: bool
|
is_summary: bool
|
||||||
output_field: Union[
|
output_field: django.db.models.fields.Field
|
||||||
django.db.models.fields.DateTimeCheckMixin,
|
|
||||||
django.db.models.fields.IntegerField,
|
|
||||||
]
|
|
||||||
source_expressions: List[django.db.models.expressions.Combinable]
|
source_expressions: List[django.db.models.expressions.Combinable]
|
||||||
tzinfo: None
|
tzinfo: None
|
||||||
kind: str = ...
|
kind: str = ...
|
||||||
@@ -175,7 +172,7 @@ class Trunc(TruncBase):
|
|||||||
self,
|
self,
|
||||||
expression: str,
|
expression: str,
|
||||||
kind: str,
|
kind: str,
|
||||||
output_field: Optional[Field] = ...,
|
output_field: Optional[Union[DateTimeCheckMixin, IntegerField]] = ...,
|
||||||
tzinfo: None = ...,
|
tzinfo: None = ...,
|
||||||
**extra: Any
|
**extra: Any
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
|
|||||||
@@ -36,12 +36,7 @@ class ConcatPair(Func):
|
|||||||
extra: Dict[Any, Any]
|
extra: Dict[Any, Any]
|
||||||
is_summary: bool
|
is_summary: bool
|
||||||
output_field: django.db.models.fields.CharField
|
output_field: django.db.models.fields.CharField
|
||||||
source_expressions: List[
|
source_expressions: List[django.db.models.expressions.Combinable]
|
||||||
Union[
|
|
||||||
django.db.models.expressions.Expression,
|
|
||||||
django.db.models.expressions.F,
|
|
||||||
]
|
|
||||||
]
|
|
||||||
function: str = ...
|
function: str = ...
|
||||||
def as_sqlite(
|
def as_sqlite(
|
||||||
self, compiler: SQLCompiler, connection: DatabaseWrapper
|
self, compiler: SQLCompiler, connection: DatabaseWrapper
|
||||||
@@ -157,12 +152,7 @@ class Repeat(BytesToCharFieldConversionMixin, Func):
|
|||||||
extra: Dict[Any, Any]
|
extra: Dict[Any, Any]
|
||||||
is_summary: bool
|
is_summary: bool
|
||||||
output_field: django.db.models.fields.CharField
|
output_field: django.db.models.fields.CharField
|
||||||
source_expressions: List[
|
source_expressions: List[django.db.models.expressions.Combinable]
|
||||||
Union[
|
|
||||||
django.db.models.expressions.Expression,
|
|
||||||
django.db.models.expressions.F,
|
|
||||||
]
|
|
||||||
]
|
|
||||||
function: str = ...
|
function: str = ...
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
|
|||||||
@@ -1,13 +1,12 @@
|
|||||||
from datetime import date, datetime, timedelta
|
from datetime import date, datetime
|
||||||
from decimal import Decimal
|
from decimal import Decimal
|
||||||
from typing import Any, Dict, List, Optional, Set, Tuple, Type, Union
|
from typing import Any, Dict, List, Optional, Tuple, Type, Union
|
||||||
from uuid import UUID
|
from uuid import UUID
|
||||||
|
|
||||||
from django.contrib.contenttypes.models import ContentType
|
|
||||||
from django.db.backends.sqlite3.base import DatabaseWrapper
|
from django.db.backends.sqlite3.base import DatabaseWrapper
|
||||||
from django.db.models.base import Model
|
from django.db.models.base import Model
|
||||||
from django.db.models.expressions import (Col, Combinable, CombinedExpression,
|
from django.db.models.expressions import (Col, Combinable, Expression, Func,
|
||||||
Expression, F, Func, Ref, Subquery)
|
Ref, Subquery)
|
||||||
from django.db.models.fields import TextField
|
from django.db.models.fields import TextField
|
||||||
from django.db.models.fields.related_lookups import MultiColSource
|
from django.db.models.fields.related_lookups import MultiColSource
|
||||||
from django.db.models.query_utils import RegisterLookupMixin
|
from django.db.models.query_utils import RegisterLookupMixin
|
||||||
@@ -23,37 +22,7 @@ class Lookup:
|
|||||||
rhs: Any = ...
|
rhs: Any = ...
|
||||||
bilateral_transforms: Any = ...
|
bilateral_transforms: Any = ...
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self, lhs: Union[Expression, TextField, MultiColSource], rhs: Any
|
||||||
lhs: Union[Expression, TextField, MultiColSource],
|
|
||||||
rhs: Optional[
|
|
||||||
Union[
|
|
||||||
Dict[Any, Any],
|
|
||||||
List[Dict[str, str]],
|
|
||||||
List[List[str]],
|
|
||||||
List[Optional[Combinable]],
|
|
||||||
List[Union[Model, int]],
|
|
||||||
List[Union[int, str]],
|
|
||||||
List[datetime],
|
|
||||||
Set[Optional[int]],
|
|
||||||
Set[ContentType],
|
|
||||||
Set[str],
|
|
||||||
Set[UUID],
|
|
||||||
Tuple,
|
|
||||||
bytes,
|
|
||||||
date,
|
|
||||||
timedelta,
|
|
||||||
Decimal,
|
|
||||||
Model,
|
|
||||||
Combinable,
|
|
||||||
Query,
|
|
||||||
float,
|
|
||||||
frozenset,
|
|
||||||
int,
|
|
||||||
range,
|
|
||||||
str,
|
|
||||||
UUID,
|
|
||||||
]
|
|
||||||
],
|
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
def apply_bilateral_transforms(self, value: Expression) -> Transform: ...
|
def apply_bilateral_transforms(self, value: Expression) -> Transform: ...
|
||||||
def batch_process_rhs(
|
def batch_process_rhs(
|
||||||
@@ -68,25 +37,7 @@ class Lookup:
|
|||||||
def get_source_expressions(self) -> List[Expression]: ...
|
def get_source_expressions(self) -> List[Expression]: ...
|
||||||
lhs: Any = ...
|
lhs: Any = ...
|
||||||
def set_source_expressions(self, new_exprs: List[Ref]) -> None: ...
|
def set_source_expressions(self, new_exprs: List[Ref]) -> None: ...
|
||||||
def get_prep_lookup(
|
def get_prep_lookup(self) -> Any: ...
|
||||||
self
|
|
||||||
) -> Optional[
|
|
||||||
Union[
|
|
||||||
Dict[Any, Any],
|
|
||||||
List[Any],
|
|
||||||
bytes,
|
|
||||||
date,
|
|
||||||
timedelta,
|
|
||||||
Decimal,
|
|
||||||
Model,
|
|
||||||
Combinable,
|
|
||||||
Query,
|
|
||||||
float,
|
|
||||||
int,
|
|
||||||
str,
|
|
||||||
UUID,
|
|
||||||
]
|
|
||||||
]: ...
|
|
||||||
def get_db_prep_lookup(
|
def get_db_prep_lookup(
|
||||||
self, value: Union[int, str], connection: DatabaseWrapper
|
self, value: Union[int, str], connection: DatabaseWrapper
|
||||||
) -> Tuple[str, Union[List[int], List[str]]]: ...
|
) -> Tuple[str, Union[List[int], List[str]]]: ...
|
||||||
@@ -143,8 +94,8 @@ class BuiltinLookup(Lookup):
|
|||||||
List[Optional[int]],
|
List[Optional[int]],
|
||||||
List[Union[date, str]],
|
List[Union[date, str]],
|
||||||
List[Union[Decimal, int]],
|
List[Union[Decimal, int]],
|
||||||
List[Union[float, int]],
|
|
||||||
List[Union[int, str]],
|
List[Union[int, str]],
|
||||||
|
List[float],
|
||||||
List[memoryview],
|
List[memoryview],
|
||||||
],
|
],
|
||||||
]: ...
|
]: ...
|
||||||
@@ -153,29 +104,12 @@ class BuiltinLookup(Lookup):
|
|||||||
class FieldGetDbPrepValueMixin:
|
class FieldGetDbPrepValueMixin:
|
||||||
get_db_prep_lookup_value_is_iterable: bool = ...
|
get_db_prep_lookup_value_is_iterable: bool = ...
|
||||||
def get_db_prep_lookup(
|
def get_db_prep_lookup(
|
||||||
self,
|
self, value: Any, connection: DatabaseWrapper
|
||||||
value: Union[
|
|
||||||
Dict[Any, Any],
|
|
||||||
List[Union[Combinable, int]],
|
|
||||||
List[datetime],
|
|
||||||
bytes,
|
|
||||||
date,
|
|
||||||
timedelta,
|
|
||||||
Decimal,
|
|
||||||
OrderedSet,
|
|
||||||
float,
|
|
||||||
int,
|
|
||||||
str,
|
|
||||||
UUID,
|
|
||||||
],
|
|
||||||
connection: DatabaseWrapper,
|
|
||||||
) -> Tuple[
|
) -> Tuple[
|
||||||
str,
|
str,
|
||||||
Union[
|
Union[
|
||||||
List[Optional[int]],
|
List[Optional[int]],
|
||||||
List[Union[CombinedExpression, F]],
|
List[Union[Combinable, int]],
|
||||||
List[Union[CombinedExpression, int]],
|
|
||||||
List[Union[F, int]],
|
|
||||||
List[Decimal],
|
List[Decimal],
|
||||||
List[float],
|
List[float],
|
||||||
List[memoryview],
|
List[memoryview],
|
||||||
@@ -219,23 +153,7 @@ class Exact(FieldGetDbPrepValueMixin, BuiltinLookup):
|
|||||||
contains_aggregate: bool
|
contains_aggregate: bool
|
||||||
contains_over_clause: bool
|
contains_over_clause: bool
|
||||||
lhs: django.db.models.expressions.Expression
|
lhs: django.db.models.expressions.Expression
|
||||||
rhs: Optional[
|
rhs: Any
|
||||||
Union[
|
|
||||||
Dict[Any, Any],
|
|
||||||
List[Dict[str, str]],
|
|
||||||
List[List[str]],
|
|
||||||
bytes,
|
|
||||||
datetime.date,
|
|
||||||
datetime.timedelta,
|
|
||||||
decimal.Decimal,
|
|
||||||
django.db.models.expressions.Combinable,
|
|
||||||
django.db.models.expressions.SQLiteNumericMixin,
|
|
||||||
float,
|
|
||||||
int,
|
|
||||||
str,
|
|
||||||
uuid.UUID,
|
|
||||||
]
|
|
||||||
]
|
|
||||||
lookup_name: str = ...
|
lookup_name: str = ...
|
||||||
def process_rhs(
|
def process_rhs(
|
||||||
self, compiler: SQLCompiler, connection: DatabaseWrapper
|
self, compiler: SQLCompiler, connection: DatabaseWrapper
|
||||||
@@ -265,62 +183,40 @@ class IExact(BuiltinLookup):
|
|||||||
class GreaterThan(FieldGetDbPrepValueMixin, BuiltinLookup):
|
class GreaterThan(FieldGetDbPrepValueMixin, BuiltinLookup):
|
||||||
bilateral_transforms: List[Any]
|
bilateral_transforms: List[Any]
|
||||||
contains_aggregate: bool
|
contains_aggregate: bool
|
||||||
lhs: django.db.models.expressions.Expression
|
lhs: Union[
|
||||||
rhs: Optional[
|
django.db.models.expressions.Expression,
|
||||||
Union[
|
django.db.models.expressions.SQLiteNumericMixin,
|
||||||
datetime.date,
|
|
||||||
datetime.timedelta,
|
|
||||||
decimal.Decimal,
|
|
||||||
django.db.models.expressions.Col,
|
|
||||||
django.db.models.expressions.SQLiteNumericMixin,
|
|
||||||
django.db.models.sql.query.Query,
|
|
||||||
float,
|
|
||||||
int,
|
|
||||||
str,
|
|
||||||
]
|
|
||||||
]
|
]
|
||||||
|
rhs: Any
|
||||||
lookup_name: str = ...
|
lookup_name: str = ...
|
||||||
|
|
||||||
class GreaterThanOrEqual(FieldGetDbPrepValueMixin, BuiltinLookup):
|
class GreaterThanOrEqual(FieldGetDbPrepValueMixin, BuiltinLookup):
|
||||||
bilateral_transforms: List[Any]
|
bilateral_transforms: List[Any]
|
||||||
contains_aggregate: bool
|
contains_aggregate: bool
|
||||||
lhs: django.db.models.expressions.Expression
|
lhs: django.db.models.expressions.Expression
|
||||||
rhs: Union[
|
rhs: Any
|
||||||
datetime.date,
|
|
||||||
datetime.timedelta,
|
|
||||||
decimal.Decimal,
|
|
||||||
django.db.models.expressions.Combinable,
|
|
||||||
int,
|
|
||||||
str,
|
|
||||||
]
|
|
||||||
lookup_name: str = ...
|
lookup_name: str = ...
|
||||||
|
|
||||||
class LessThan(FieldGetDbPrepValueMixin, BuiltinLookup):
|
class LessThan(FieldGetDbPrepValueMixin, BuiltinLookup):
|
||||||
bilateral_transforms: List[Any]
|
bilateral_transforms: List[Any]
|
||||||
contains_aggregate: bool
|
contains_aggregate: bool
|
||||||
lhs: django.db.models.expressions.Expression
|
lhs: django.db.models.expressions.Expression
|
||||||
rhs: Union[
|
rhs: Any
|
||||||
datetime.date,
|
|
||||||
datetime.timedelta,
|
|
||||||
decimal.Decimal,
|
|
||||||
django.db.models.expressions.CombinedExpression,
|
|
||||||
float,
|
|
||||||
int,
|
|
||||||
str,
|
|
||||||
]
|
|
||||||
lookup_name: str = ...
|
lookup_name: str = ...
|
||||||
|
|
||||||
class LessThanOrEqual(FieldGetDbPrepValueMixin, BuiltinLookup):
|
class LessThanOrEqual(FieldGetDbPrepValueMixin, BuiltinLookup):
|
||||||
bilateral_transforms: List[Type[django.db.models.lookups.Transform]]
|
bilateral_transforms: List[Type[django.db.models.lookups.Transform]]
|
||||||
contains_aggregate: bool
|
contains_aggregate: bool
|
||||||
contains_over_clause: bool
|
contains_over_clause: bool
|
||||||
lhs: django.db.models.expressions.Expression
|
lhs: Union[
|
||||||
|
django.db.models.expressions.Expression,
|
||||||
|
django.db.models.expressions.SQLiteNumericMixin,
|
||||||
|
]
|
||||||
rhs: Union[
|
rhs: Union[
|
||||||
datetime.date,
|
datetime.date,
|
||||||
decimal.Decimal,
|
decimal.Decimal,
|
||||||
django.db.models.expressions.Expression,
|
django.db.models.expressions.Expression,
|
||||||
float,
|
float,
|
||||||
int,
|
|
||||||
]
|
]
|
||||||
lookup_name: str = ...
|
lookup_name: str = ...
|
||||||
|
|
||||||
@@ -337,20 +233,7 @@ class In(FieldGetDbPrepValueIterableMixin, BuiltinLookup):
|
|||||||
bilateral_transforms: List[Type[django.db.models.lookups.Transform]]
|
bilateral_transforms: List[Type[django.db.models.lookups.Transform]]
|
||||||
contains_aggregate: bool
|
contains_aggregate: bool
|
||||||
lhs: django.db.models.expressions.Expression
|
lhs: django.db.models.expressions.Expression
|
||||||
rhs: Union[
|
rhs: Any
|
||||||
List[Optional[django.db.models.expressions.Combinable]],
|
|
||||||
List[Optional[int]],
|
|
||||||
List[datetime.datetime],
|
|
||||||
List[django.db.models.base.Model],
|
|
||||||
List[str],
|
|
||||||
Set[Optional[int]],
|
|
||||||
Set[str],
|
|
||||||
Tuple,
|
|
||||||
django.db.models.expressions.Subquery,
|
|
||||||
django.db.models.sql.query.Query,
|
|
||||||
frozenset,
|
|
||||||
range,
|
|
||||||
]
|
|
||||||
lookup_name: str = ...
|
lookup_name: str = ...
|
||||||
def process_rhs(
|
def process_rhs(
|
||||||
self, compiler: SQLCompiler, connection: DatabaseWrapper
|
self, compiler: SQLCompiler, connection: DatabaseWrapper
|
||||||
@@ -421,7 +304,7 @@ class Range(FieldGetDbPrepValueIterableMixin, BuiltinLookup):
|
|||||||
List[Union[django.db.models.expressions.Combinable, int]],
|
List[Union[django.db.models.expressions.Combinable, int]],
|
||||||
List[datetime.datetime],
|
List[datetime.datetime],
|
||||||
Tuple[
|
Tuple[
|
||||||
Union[django.db.models.expressions.CombinedExpression, int],
|
Union[django.db.models.expressions.Combinable, int],
|
||||||
Union[django.db.models.expressions.CombinedExpression, int],
|
Union[django.db.models.expressions.CombinedExpression, int],
|
||||||
],
|
],
|
||||||
Tuple[datetime.datetime, datetime.datetime],
|
Tuple[datetime.datetime, datetime.datetime],
|
||||||
|
|||||||
@@ -5,6 +5,8 @@ from django.apps.config import AppConfig
|
|||||||
from django.contrib.auth.base_user import AbstractBaseUser
|
from django.contrib.auth.base_user import AbstractBaseUser
|
||||||
from django.contrib.auth.models import AbstractUser, PermissionsMixin
|
from django.contrib.auth.models import AbstractUser, PermissionsMixin
|
||||||
from django.contrib.contenttypes.fields import GenericForeignKey
|
from django.contrib.contenttypes.fields import GenericForeignKey
|
||||||
|
from django.contrib.postgres.fields.array import ArrayField
|
||||||
|
from django.contrib.postgres.fields.citext import CIText
|
||||||
from django.contrib.sessions.base_session import AbstractBaseSession
|
from django.contrib.sessions.base_session import AbstractBaseSession
|
||||||
from django.db.backends.sqlite3.base import DatabaseWrapper
|
from django.db.backends.sqlite3.base import DatabaseWrapper
|
||||||
from django.db.models.base import Model
|
from django.db.models.base import Model
|
||||||
@@ -22,27 +24,17 @@ IMMUTABLE_WARNING: str
|
|||||||
DEFAULT_NAMES: Any
|
DEFAULT_NAMES: Any
|
||||||
|
|
||||||
def normalize_together(
|
def normalize_together(
|
||||||
option_together: Optional[
|
option_together: Any
|
||||||
Union[
|
|
||||||
List[List[str]],
|
|
||||||
List[Union[Tuple[str, str], int]],
|
|
||||||
List[str],
|
|
||||||
Set[Union[Tuple[str, str, str, str], Tuple[str, str]]],
|
|
||||||
Tuple[Tuple[str, str]],
|
|
||||||
Tuple[str, str],
|
|
||||||
int,
|
|
||||||
str,
|
|
||||||
]
|
|
||||||
]
|
|
||||||
) -> Union[
|
) -> Union[
|
||||||
List[Union[Tuple[str, str], int]],
|
List[Union[Tuple[str, str], int]], Set[Tuple[str, str]], Tuple, int, str
|
||||||
Set[Union[Tuple[str, str, str, str], Tuple[str, str]]],
|
|
||||||
Tuple,
|
|
||||||
int,
|
|
||||||
str,
|
|
||||||
]: ...
|
]: ...
|
||||||
def make_immutable_fields_list(
|
def make_immutable_fields_list(
|
||||||
name: str, data: Union[Iterator[Any], List[Union[Field, FieldCacheMixin]]]
|
name: str,
|
||||||
|
data: Union[
|
||||||
|
Iterator[Any],
|
||||||
|
List[Union[ArrayField, CIText]],
|
||||||
|
List[Union[Field, mixins.FieldCacheMixin]],
|
||||||
|
],
|
||||||
) -> ImmutableList: ...
|
) -> ImmutableList: ...
|
||||||
|
|
||||||
class Options:
|
class Options:
|
||||||
@@ -57,11 +49,7 @@ class Options:
|
|||||||
FORWARD_PROPERTIES: Any = ...
|
FORWARD_PROPERTIES: Any = ...
|
||||||
REVERSE_PROPERTIES: Any = ...
|
REVERSE_PROPERTIES: Any = ...
|
||||||
default_apps: Any = ...
|
default_apps: Any = ...
|
||||||
local_fields: List[
|
local_fields: List[django.db.models.fields.Field] = ...
|
||||||
Union[
|
|
||||||
django.db.models.fields.AutoField, django.db.models.fields.CharField
|
|
||||||
]
|
|
||||||
] = ...
|
|
||||||
local_many_to_many: List[
|
local_many_to_many: List[
|
||||||
django.db.models.fields.related.ManyToManyField
|
django.db.models.fields.related.ManyToManyField
|
||||||
] = ...
|
] = ...
|
||||||
@@ -90,7 +78,6 @@ class Options:
|
|||||||
meta: Optional[
|
meta: Optional[
|
||||||
Type[
|
Type[
|
||||||
Union[
|
Union[
|
||||||
Any,
|
|
||||||
django.contrib.auth.base_user.AbstractBaseUser.Meta,
|
django.contrib.auth.base_user.AbstractBaseUser.Meta,
|
||||||
django.contrib.auth.models.AbstractUser.Meta,
|
django.contrib.auth.models.AbstractUser.Meta,
|
||||||
django.contrib.auth.models.PermissionsMixin.Meta,
|
django.contrib.auth.models.PermissionsMixin.Meta,
|
||||||
@@ -116,7 +103,6 @@ class Options:
|
|||||||
meta: Optional[
|
meta: Optional[
|
||||||
Type[
|
Type[
|
||||||
Union[
|
Union[
|
||||||
Any,
|
|
||||||
AbstractBaseUser.Meta,
|
AbstractBaseUser.Meta,
|
||||||
AbstractUser.Meta,
|
AbstractUser.Meta,
|
||||||
PermissionsMixin.Meta,
|
PermissionsMixin.Meta,
|
||||||
@@ -163,7 +149,7 @@ class Options:
|
|||||||
def fields_map(self) -> Dict[str, ForeignObjectRel]: ...
|
def fields_map(self) -> Dict[str, ForeignObjectRel]: ...
|
||||||
def get_field(
|
def get_field(
|
||||||
self, field_name: Union[Callable, str]
|
self, field_name: Union[Callable, str]
|
||||||
) -> Union[Field, mixins.FieldCacheMixin]: ...
|
) -> Union[Field, FieldCacheMixin]: ...
|
||||||
def get_base_chain(self, model: Type[Model]) -> List[Type[Model]]: ...
|
def get_base_chain(self, model: Type[Model]) -> List[Type[Model]]: ...
|
||||||
def get_parent_list(self) -> List[Type[Model]]: ...
|
def get_parent_list(self) -> List[Type[Model]]: ...
|
||||||
def get_ancestor_link(
|
def get_ancestor_link(
|
||||||
|
|||||||
+26
-1028
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,4 @@
|
|||||||
from collections import OrderedDict, namedtuple
|
from collections import OrderedDict, namedtuple
|
||||||
from datetime import date
|
|
||||||
from decimal import Decimal
|
|
||||||
from typing import Any, Dict, Iterator, List, Optional, Set, Tuple, Type, Union
|
from typing import Any, Dict, Iterator, List, Optional, Set, Tuple, Type, Union
|
||||||
|
|
||||||
from django.db.backends.sqlite3.base import DatabaseWrapper
|
from django.db.backends.sqlite3.base import DatabaseWrapper
|
||||||
@@ -8,7 +6,8 @@ from django.db.models.base import Model
|
|||||||
from django.db.models.expressions import Expression, F
|
from django.db.models.expressions import Expression, F
|
||||||
from django.db.models.fields import Field
|
from django.db.models.fields import Field
|
||||||
from django.db.models.fields.mixins import FieldCacheMixin
|
from django.db.models.fields.mixins import FieldCacheMixin
|
||||||
from django.db.models.lookups import Lookup, Transform
|
from django.db.models.functions.datetime import TimezoneMixin
|
||||||
|
from django.db.models.lookups import BuiltinLookup, Lookup, Transform
|
||||||
from django.db.models.options import Options
|
from django.db.models.options import Options
|
||||||
from django.db.models.sql.compiler import SQLCompiler
|
from django.db.models.sql.compiler import SQLCompiler
|
||||||
from django.db.models.sql.query import Query
|
from django.db.models.sql.query import Query
|
||||||
@@ -37,89 +36,7 @@ class QueryWrapper:
|
|||||||
class Q(tree.Node):
|
class Q(tree.Node):
|
||||||
children: Union[
|
children: Union[
|
||||||
List[Dict[str, str]],
|
List[Dict[str, str]],
|
||||||
List[
|
List[Union[Tuple[str, Any], django.db.models.query_utils.Q]],
|
||||||
Union[
|
|
||||||
Tuple[
|
|
||||||
str,
|
|
||||||
Optional[
|
|
||||||
Union[
|
|
||||||
Any,
|
|
||||||
Dict[Any, Any],
|
|
||||||
Iterator[Any],
|
|
||||||
List[Any],
|
|
||||||
List[Dict[str, str]],
|
|
||||||
List[List[str]],
|
|
||||||
List[None],
|
|
||||||
List[Union[django.db.models.base.Model, int]],
|
|
||||||
List[
|
|
||||||
Union[
|
|
||||||
django.db.models.expressions.CombinedExpression,
|
|
||||||
django.db.models.expressions.F,
|
|
||||||
]
|
|
||||||
],
|
|
||||||
List[Union[int, str]],
|
|
||||||
List[datetime.datetime],
|
|
||||||
List[django.contrib.auth.models.Group],
|
|
||||||
List[django.contrib.auth.models.Permission],
|
|
||||||
List[django.contrib.auth.models.User],
|
|
||||||
List[
|
|
||||||
django.contrib.contenttypes.models.ContentType
|
|
||||||
],
|
|
||||||
List[django.db.models.base.Model],
|
|
||||||
List[
|
|
||||||
django.db.models.expressions.CombinedExpression
|
|
||||||
],
|
|
||||||
List[django.db.models.expressions.F],
|
|
||||||
List[int],
|
|
||||||
List[str],
|
|
||||||
Set[Any],
|
|
||||||
Set[Optional[int]],
|
|
||||||
Set[django.contrib.contenttypes.models.ContentType],
|
|
||||||
Set[int],
|
|
||||||
Set[str],
|
|
||||||
Set[uuid.UUID],
|
|
||||||
Tuple,
|
|
||||||
bytes,
|
|
||||||
datetime.date,
|
|
||||||
datetime.timedelta,
|
|
||||||
decimal.Decimal,
|
|
||||||
django.db.models.base.Model,
|
|
||||||
django.db.models.expressions.Case,
|
|
||||||
django.db.models.expressions.CombinedExpression,
|
|
||||||
django.db.models.expressions.F,
|
|
||||||
django.db.models.expressions.Subquery,
|
|
||||||
django.db.models.functions.datetime.Extract,
|
|
||||||
django.db.models.functions.datetime.Now,
|
|
||||||
django.db.models.functions.datetime.Trunc,
|
|
||||||
django.db.models.functions.datetime.TruncDate,
|
|
||||||
django.db.models.functions.datetime.TruncDay,
|
|
||||||
django.db.models.functions.datetime.TruncHour,
|
|
||||||
django.db.models.functions.datetime.TruncMinute,
|
|
||||||
django.db.models.functions.datetime.TruncMonth,
|
|
||||||
django.db.models.functions.datetime.TruncSecond,
|
|
||||||
django.db.models.functions.datetime.TruncTime,
|
|
||||||
django.db.models.functions.datetime.TruncWeek,
|
|
||||||
django.db.models.functions.datetime.TruncYear,
|
|
||||||
django.db.models.functions.text.Chr,
|
|
||||||
django.db.models.functions.text.Length,
|
|
||||||
django.db.models.functions.text.Ord,
|
|
||||||
django.db.models.functions.text.Substr,
|
|
||||||
django.db.models.functions.text.Upper,
|
|
||||||
django.db.models.query.QuerySet,
|
|
||||||
django.db.models.sql.query.Query,
|
|
||||||
django.utils.functional.SimpleLazyObject,
|
|
||||||
float,
|
|
||||||
frozenset,
|
|
||||||
int,
|
|
||||||
range,
|
|
||||||
str,
|
|
||||||
uuid.UUID,
|
|
||||||
]
|
|
||||||
],
|
|
||||||
],
|
|
||||||
django.db.models.query_utils.Q,
|
|
||||||
]
|
|
||||||
],
|
|
||||||
]
|
]
|
||||||
connector: str
|
connector: str
|
||||||
negated: bool
|
negated: bool
|
||||||
@@ -150,7 +67,7 @@ class DeferredAttribute:
|
|||||||
def __init__(self, field_name: str) -> None: ...
|
def __init__(self, field_name: str) -> None: ...
|
||||||
def __get__(
|
def __get__(
|
||||||
self, instance: Optional[Model], cls: Type[Model] = ...
|
self, instance: Optional[Model], cls: Type[Model] = ...
|
||||||
) -> Optional[Union[date, Decimal, DeferredAttribute, float, int, str]]: ...
|
) -> Any: ...
|
||||||
|
|
||||||
class RegisterLookupMixin:
|
class RegisterLookupMixin:
|
||||||
@classmethod
|
@classmethod
|
||||||
@@ -159,7 +76,10 @@ class RegisterLookupMixin:
|
|||||||
def get_transform(self, lookup_name: str) -> Optional[Type[Transform]]: ...
|
def get_transform(self, lookup_name: str) -> Optional[Type[Transform]]: ...
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def merge_dicts(
|
def merge_dicts(
|
||||||
dicts: List[Dict[str, Type[Union[Lookup, Transform]]]]
|
dicts: Union[
|
||||||
|
List[Dict[str, Type[Union[TimezoneMixin, BuiltinLookup]]]],
|
||||||
|
List[Dict[str, Type[Union[Lookup, Transform]]]],
|
||||||
|
]
|
||||||
) -> Dict[str, Type[Union[Lookup, Transform]]]: ...
|
) -> Dict[str, Type[Union[Lookup, Transform]]]: ...
|
||||||
@classmethod
|
@classmethod
|
||||||
def register_lookup(
|
def register_lookup(
|
||||||
@@ -193,10 +113,8 @@ def select_related_descend(
|
|||||||
) -> bool: ...
|
) -> bool: ...
|
||||||
def refs_expression(
|
def refs_expression(
|
||||||
lookup_parts: List[str], annotations: OrderedDict
|
lookup_parts: List[str], annotations: OrderedDict
|
||||||
) -> Union[
|
) -> Tuple[
|
||||||
Tuple[List[str], List[str]],
|
Union[List[str], Tuple, Expression], Union[List[Any], List[str], Tuple]
|
||||||
Tuple[bool, Tuple],
|
|
||||||
Tuple[Expression, List[Any]],
|
|
||||||
]: ...
|
]: ...
|
||||||
def check_rel_lookup_compatibility(
|
def check_rel_lookup_compatibility(
|
||||||
model: Type[Model], target_opts: Options, field: FieldCacheMixin
|
model: Type[Model], target_opts: Options, field: FieldCacheMixin
|
||||||
|
|||||||
@@ -5,27 +5,15 @@ from typing import (Any, Callable, Dict, Iterator, List, Optional, Set, Tuple,
|
|||||||
Type, Union)
|
Type, Union)
|
||||||
from uuid import UUID
|
from uuid import UUID
|
||||||
|
|
||||||
from django.contrib.auth.models import User
|
|
||||||
from django.contrib.contenttypes.models import ContentType
|
|
||||||
from django.db.backends.sqlite3.base import DatabaseWrapper
|
from django.db.backends.sqlite3.base import DatabaseWrapper
|
||||||
from django.db.backends.utils import CursorWrapper
|
from django.db.backends.utils import CursorWrapper
|
||||||
from django.db.models.base import Model
|
from django.db.models.base import Model
|
||||||
from django.db.models.expressions import (BaseExpression, Col, Combinable,
|
from django.db.models.expressions import (BaseExpression, Col, Expression,
|
||||||
Expression, OrderBy, RawSQL,
|
OrderBy, SQLiteNumericMixin)
|
||||||
SQLiteNumericMixin)
|
from django.db.models.fields import DateTimeCheckMixin, Field
|
||||||
from django.db.models.fields import Field
|
|
||||||
from django.db.models.fields.files import FieldFile
|
|
||||||
from django.db.models.fields.mixins import FieldCacheMixin
|
|
||||||
from django.db.models.fields.related import (ForeignKey, ForeignObject,
|
|
||||||
OneToOneField)
|
|
||||||
from django.db.models.functions.text import Lower
|
from django.db.models.functions.text import Lower
|
||||||
from django.db.models.lookups import Lookup
|
|
||||||
from django.db.models.options import Options
|
from django.db.models.options import Options
|
||||||
from django.db.models.query_utils import FilteredRelation, QueryWrapper
|
|
||||||
from django.db.models.sql.datastructures import BaseTable, Join
|
|
||||||
from django.db.models.sql.query import Query, RawQuery
|
from django.db.models.sql.query import Query, RawQuery
|
||||||
from django.db.models.sql.where import (ExtraWhere, NothingNode,
|
|
||||||
SubqueryConstraint, WhereNode)
|
|
||||||
from django.utils.datastructures import ImmutableList
|
from django.utils.datastructures import ImmutableList
|
||||||
|
|
||||||
FORCE: Any
|
FORCE: Any
|
||||||
@@ -50,46 +38,29 @@ class SQLCompiler:
|
|||||||
has_extra_select: Any = ...
|
has_extra_select: Any = ...
|
||||||
def pre_sql_setup(
|
def pre_sql_setup(
|
||||||
self
|
self
|
||||||
) -> Union[
|
) -> Tuple[
|
||||||
Tuple[
|
Union[
|
||||||
List[Any],
|
List[Tuple[OrderBy, Tuple[str, Tuple[str, str], bool]]],
|
||||||
List[Any],
|
List[Tuple[str, List[int]]],
|
||||||
List[Union[Tuple[str, List[Any]], Tuple[str, List[str]]]],
|
List[Tuple[str, Union[List[float], List[str]]]],
|
||||||
],
|
],
|
||||||
Tuple[
|
Union[
|
||||||
List[Any],
|
List[Tuple[OrderBy, Tuple[str, List[Any], bool]]],
|
||||||
List[
|
List[Tuple[str, List[int]]],
|
||||||
Tuple[
|
List[Tuple[str, Union[List[float], List[str]]]],
|
||||||
OrderBy,
|
|
||||||
Union[
|
|
||||||
Tuple[str, List[Any], bool],
|
|
||||||
Tuple[str, List[int], bool],
|
|
||||||
Tuple[str, List[str], bool],
|
|
||||||
Tuple[str, Tuple, bool],
|
|
||||||
],
|
|
||||||
]
|
|
||||||
],
|
|
||||||
List[
|
|
||||||
Union[Any, Tuple[str, Union[List[Any], List[float], List[int]]]]
|
|
||||||
],
|
|
||||||
],
|
],
|
||||||
Tuple[
|
Union[
|
||||||
List[Tuple[OrderBy, None, None]],
|
List[Any],
|
||||||
List[
|
List[Tuple[str, List[int]]],
|
||||||
Tuple[
|
List[Tuple[str, Union[List[float], List[str]]]],
|
||||||
OrderBy,
|
|
||||||
Union[
|
|
||||||
Tuple[str, List[Union[int, str]], bool],
|
|
||||||
Tuple[str, Tuple[str, str], bool],
|
|
||||||
],
|
|
||||||
]
|
|
||||||
],
|
|
||||||
List[Union[Any, Tuple[str, List[int]]]],
|
|
||||||
],
|
],
|
||||||
]: ...
|
]: ...
|
||||||
def get_group_by(
|
def get_group_by(
|
||||||
self,
|
self,
|
||||||
select: List[Tuple[BaseExpression, Optional[str], Optional[str]]],
|
select: Union[
|
||||||
|
List[Tuple[BaseExpression, Optional[str], Optional[str]]],
|
||||||
|
List[Tuple[SQLiteNumericMixin, Tuple[str, List[int]], str]],
|
||||||
|
],
|
||||||
order_by: List[
|
order_by: List[
|
||||||
Tuple[
|
Tuple[
|
||||||
OrderBy,
|
OrderBy,
|
||||||
@@ -103,9 +74,7 @@ class SQLCompiler:
|
|||||||
],
|
],
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
) -> List[
|
) -> List[Tuple[str, Union[List[float], List[int], List[str]]]]: ...
|
||||||
Tuple[str, Union[List[Any], List[float], List[int], List[str]]]
|
|
||||||
]: ...
|
|
||||||
def collapse_group_by(
|
def collapse_group_by(
|
||||||
self,
|
self,
|
||||||
expressions: List[Expression],
|
expressions: List[Expression],
|
||||||
@@ -113,202 +82,10 @@ class SQLCompiler:
|
|||||||
) -> List[Expression]: ...
|
) -> List[Expression]: ...
|
||||||
def get_select(
|
def get_select(
|
||||||
self
|
self
|
||||||
) -> Union[
|
) -> Tuple[
|
||||||
Tuple[
|
Optional[Dict[str, int]],
|
||||||
List[Tuple[Col, Tuple[str, List[Any]], None]],
|
Union[Dict[Any, Any], Dict[str, int]],
|
||||||
Dict[
|
Union[Dict[Any, Any], Dict[str, int]],
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
List[
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
Callable,
|
|
||||||
List[Any],
|
|
||||||
List[int],
|
|
||||||
Type[Model],
|
|
||||||
bool,
|
|
||||||
OneToOneField,
|
|
||||||
],
|
|
||||||
]
|
|
||||||
],
|
|
||||||
List[int],
|
|
||||||
Type[Model],
|
|
||||||
],
|
|
||||||
],
|
|
||||||
Dict[Any, Any],
|
|
||||||
],
|
|
||||||
Tuple[
|
|
||||||
List[Tuple[Expression, Optional[str], Optional[str]]],
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
List[
|
|
||||||
Union[
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
Callable,
|
|
||||||
List[Any],
|
|
||||||
List[int],
|
|
||||||
Type[User],
|
|
||||||
bool,
|
|
||||||
ForeignKey,
|
|
||||||
],
|
|
||||||
],
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
Callable,
|
|
||||||
List[Any],
|
|
||||||
List[int],
|
|
||||||
Type[ContentType],
|
|
||||||
bool,
|
|
||||||
ForeignKey,
|
|
||||||
],
|
|
||||||
],
|
|
||||||
]
|
|
||||||
],
|
|
||||||
List[int],
|
|
||||||
Type[Model],
|
|
||||||
],
|
|
||||||
],
|
|
||||||
Dict[str, int],
|
|
||||||
],
|
|
||||||
Tuple[
|
|
||||||
List[Tuple[Expression, Tuple[str, List[int]], Optional[str]]],
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
List[
|
|
||||||
Union[
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
Callable,
|
|
||||||
List[Any],
|
|
||||||
List[int],
|
|
||||||
Type[Model],
|
|
||||||
bool,
|
|
||||||
ForeignKey,
|
|
||||||
],
|
|
||||||
],
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
Callable,
|
|
||||||
List[
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
Callable,
|
|
||||||
List[Any],
|
|
||||||
List[int],
|
|
||||||
Type[Model],
|
|
||||||
bool,
|
|
||||||
ForeignKey,
|
|
||||||
],
|
|
||||||
]
|
|
||||||
],
|
|
||||||
List[int],
|
|
||||||
Type[Model],
|
|
||||||
bool,
|
|
||||||
ForeignKey,
|
|
||||||
],
|
|
||||||
],
|
|
||||||
]
|
|
||||||
],
|
|
||||||
List[int],
|
|
||||||
Type[Model],
|
|
||||||
],
|
|
||||||
],
|
|
||||||
Dict[str, int],
|
|
||||||
],
|
|
||||||
Tuple[List[Tuple[Expression, str, str]], None, Dict[str, int]],
|
|
||||||
Tuple[
|
|
||||||
List[
|
|
||||||
Union[
|
|
||||||
Tuple[Col, Tuple[str, List[Any]], None],
|
|
||||||
Tuple[RawSQL, Tuple[str, List[Any]], str],
|
|
||||||
]
|
|
||||||
],
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
List[
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
Callable,
|
|
||||||
List[
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
Callable,
|
|
||||||
List[
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
Callable,
|
|
||||||
List[
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
Callable,
|
|
||||||
List[
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
Callable,
|
|
||||||
List[
|
|
||||||
Any
|
|
||||||
],
|
|
||||||
List[
|
|
||||||
int
|
|
||||||
],
|
|
||||||
Type[
|
|
||||||
Model
|
|
||||||
],
|
|
||||||
bool,
|
|
||||||
ForeignKey,
|
|
||||||
],
|
|
||||||
]
|
|
||||||
],
|
|
||||||
List[int],
|
|
||||||
Type[Model],
|
|
||||||
bool,
|
|
||||||
ForeignKey,
|
|
||||||
],
|
|
||||||
]
|
|
||||||
],
|
|
||||||
List[int],
|
|
||||||
Type[Model],
|
|
||||||
bool,
|
|
||||||
ForeignKey,
|
|
||||||
],
|
|
||||||
]
|
|
||||||
],
|
|
||||||
List[int],
|
|
||||||
Type[Model],
|
|
||||||
bool,
|
|
||||||
ForeignKey,
|
|
||||||
],
|
|
||||||
]
|
|
||||||
],
|
|
||||||
List[int],
|
|
||||||
Type[Model],
|
|
||||||
bool,
|
|
||||||
ForeignKey,
|
|
||||||
],
|
|
||||||
]
|
|
||||||
],
|
|
||||||
List[int],
|
|
||||||
Type[Model],
|
|
||||||
],
|
|
||||||
],
|
|
||||||
Dict[str, int],
|
|
||||||
],
|
|
||||||
Tuple[None, Dict[str, int], Dict[str, int]],
|
|
||||||
]: ...
|
]: ...
|
||||||
def get_order_by(
|
def get_order_by(
|
||||||
self
|
self
|
||||||
@@ -338,26 +115,14 @@ class SQLCompiler:
|
|||||||
],
|
],
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
select: List[Tuple[Expression, Optional[str], Optional[str]]],
|
select: Union[
|
||||||
|
List[Tuple[Expression, Optional[str], Optional[str]]],
|
||||||
|
List[Tuple[SQLiteNumericMixin, Tuple[str, List[int]], str]],
|
||||||
|
],
|
||||||
) -> List[Tuple[OrderBy, Tuple[str, List[Any]], None]]: ...
|
) -> List[Tuple[OrderBy, Tuple[str, List[Any]], None]]: ...
|
||||||
def quote_name_unless_alias(self, name: str) -> str: ...
|
def quote_name_unless_alias(self, name: str) -> str: ...
|
||||||
def compile(
|
def compile(
|
||||||
self,
|
self, node: Any, select_format: Any = ...
|
||||||
node: Union[
|
|
||||||
Combinable,
|
|
||||||
OrderBy,
|
|
||||||
Lookup,
|
|
||||||
FilteredRelation,
|
|
||||||
QueryWrapper,
|
|
||||||
BaseTable,
|
|
||||||
Join,
|
|
||||||
Query,
|
|
||||||
ExtraWhere,
|
|
||||||
NothingNode,
|
|
||||||
SubqueryConstraint,
|
|
||||||
WhereNode,
|
|
||||||
],
|
|
||||||
select_format: Any = ...,
|
|
||||||
) -> Tuple[
|
) -> Tuple[
|
||||||
str,
|
str,
|
||||||
Union[
|
Union[
|
||||||
@@ -365,9 +130,9 @@ class SQLCompiler:
|
|||||||
List[Union[date, int]],
|
List[Union[date, int]],
|
||||||
List[Union[date, str]],
|
List[Union[date, str]],
|
||||||
List[Union[Decimal, int]],
|
List[Union[Decimal, int]],
|
||||||
List[Union[float, int]],
|
|
||||||
List[Union[int, memoryview]],
|
List[Union[int, memoryview]],
|
||||||
List[Union[int, str]],
|
List[Union[int, str]],
|
||||||
|
List[float],
|
||||||
Tuple,
|
Tuple,
|
||||||
],
|
],
|
||||||
]: ...
|
]: ...
|
||||||
@@ -393,12 +158,7 @@ class SQLCompiler:
|
|||||||
already_seen: Optional[
|
already_seen: Optional[
|
||||||
Union[
|
Union[
|
||||||
Set[
|
Set[
|
||||||
Tuple[
|
Tuple[None, Tuple[Tuple[str, str]], Tuple[Tuple[str, str]]]
|
||||||
None,
|
|
||||||
Tuple[Tuple[str, str]],
|
|
||||||
Tuple[Tuple[str, str]],
|
|
||||||
Tuple[Tuple[str, str]],
|
|
||||||
]
|
|
||||||
],
|
],
|
||||||
Set[Tuple[Tuple[Tuple[str, str]], Tuple[Tuple[str, str]]]],
|
Set[Tuple[Tuple[Tuple[str, str]], Tuple[Tuple[str, str]]]],
|
||||||
]
|
]
|
||||||
@@ -415,318 +175,23 @@ class SQLCompiler:
|
|||||||
Union[Dict[str, Dict[str, Dict[str, Dict[Any, Any]]]], bool]
|
Union[Dict[str, Dict[str, Dict[str, Dict[Any, Any]]]], bool]
|
||||||
] = ...,
|
] = ...,
|
||||||
restricted: Optional[bool] = ...,
|
restricted: Optional[bool] = ...,
|
||||||
) -> Union[
|
) -> List[Dict[str, Any]]: ...
|
||||||
List[
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
Callable,
|
|
||||||
List[
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
Callable,
|
|
||||||
List[
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
Callable,
|
|
||||||
List[Any],
|
|
||||||
List[int],
|
|
||||||
Type[Model],
|
|
||||||
bool,
|
|
||||||
OneToOneField,
|
|
||||||
],
|
|
||||||
]
|
|
||||||
],
|
|
||||||
List[int],
|
|
||||||
Type[Model],
|
|
||||||
bool,
|
|
||||||
OneToOneField,
|
|
||||||
],
|
|
||||||
]
|
|
||||||
],
|
|
||||||
List[int],
|
|
||||||
Type[Model],
|
|
||||||
bool,
|
|
||||||
FieldCacheMixin,
|
|
||||||
],
|
|
||||||
]
|
|
||||||
],
|
|
||||||
List[
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
Callable,
|
|
||||||
List[
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
Callable,
|
|
||||||
List[
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
Callable,
|
|
||||||
List[
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
Callable,
|
|
||||||
List[
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
Callable,
|
|
||||||
List[Any],
|
|
||||||
List[int],
|
|
||||||
Type[Model],
|
|
||||||
bool,
|
|
||||||
ForeignKey,
|
|
||||||
],
|
|
||||||
]
|
|
||||||
],
|
|
||||||
List[int],
|
|
||||||
Type[Model],
|
|
||||||
bool,
|
|
||||||
ForeignKey,
|
|
||||||
],
|
|
||||||
]
|
|
||||||
],
|
|
||||||
List[int],
|
|
||||||
Type[Model],
|
|
||||||
bool,
|
|
||||||
ForeignKey,
|
|
||||||
],
|
|
||||||
]
|
|
||||||
],
|
|
||||||
List[int],
|
|
||||||
Type[Model],
|
|
||||||
bool,
|
|
||||||
ForeignKey,
|
|
||||||
],
|
|
||||||
]
|
|
||||||
],
|
|
||||||
List[int],
|
|
||||||
Type[Model],
|
|
||||||
bool,
|
|
||||||
ForeignKey,
|
|
||||||
],
|
|
||||||
]
|
|
||||||
],
|
|
||||||
List[
|
|
||||||
Union[
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
Callable,
|
|
||||||
List[Any],
|
|
||||||
List[int],
|
|
||||||
Type[User],
|
|
||||||
bool,
|
|
||||||
ForeignKey,
|
|
||||||
],
|
|
||||||
],
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
Callable,
|
|
||||||
List[Any],
|
|
||||||
List[int],
|
|
||||||
Type[ContentType],
|
|
||||||
bool,
|
|
||||||
ForeignKey,
|
|
||||||
],
|
|
||||||
],
|
|
||||||
]
|
|
||||||
],
|
|
||||||
List[
|
|
||||||
Union[
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
Callable,
|
|
||||||
List[Any],
|
|
||||||
List[int],
|
|
||||||
Type[Model],
|
|
||||||
bool,
|
|
||||||
ForeignKey,
|
|
||||||
],
|
|
||||||
],
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
Callable,
|
|
||||||
List[
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
Callable,
|
|
||||||
List[Any],
|
|
||||||
List[int],
|
|
||||||
Type[Model],
|
|
||||||
bool,
|
|
||||||
ForeignKey,
|
|
||||||
],
|
|
||||||
]
|
|
||||||
],
|
|
||||||
List[int],
|
|
||||||
Type[Model],
|
|
||||||
bool,
|
|
||||||
FieldCacheMixin,
|
|
||||||
],
|
|
||||||
],
|
|
||||||
]
|
|
||||||
],
|
|
||||||
List[
|
|
||||||
Union[
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
Callable,
|
|
||||||
List[Any],
|
|
||||||
List[int],
|
|
||||||
Type[Model],
|
|
||||||
bool,
|
|
||||||
ForeignKey,
|
|
||||||
],
|
|
||||||
],
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
Callable,
|
|
||||||
List[
|
|
||||||
Union[
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
Callable,
|
|
||||||
List[Any],
|
|
||||||
List[int],
|
|
||||||
Type[Model],
|
|
||||||
bool,
|
|
||||||
ForeignKey,
|
|
||||||
],
|
|
||||||
],
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
Callable,
|
|
||||||
List[Any],
|
|
||||||
List[int],
|
|
||||||
Type[Model],
|
|
||||||
bool,
|
|
||||||
OneToOneField,
|
|
||||||
],
|
|
||||||
],
|
|
||||||
]
|
|
||||||
],
|
|
||||||
List[int],
|
|
||||||
Type[Model],
|
|
||||||
bool,
|
|
||||||
ForeignObject,
|
|
||||||
],
|
|
||||||
],
|
|
||||||
]
|
|
||||||
],
|
|
||||||
List[
|
|
||||||
Union[
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
Callable,
|
|
||||||
List[
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
Callable,
|
|
||||||
List[
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
Callable,
|
|
||||||
List[Any],
|
|
||||||
List[int],
|
|
||||||
Type[Model],
|
|
||||||
bool,
|
|
||||||
ForeignKey,
|
|
||||||
],
|
|
||||||
]
|
|
||||||
],
|
|
||||||
List[int],
|
|
||||||
Type[Model],
|
|
||||||
bool,
|
|
||||||
ForeignKey,
|
|
||||||
],
|
|
||||||
]
|
|
||||||
],
|
|
||||||
List[int],
|
|
||||||
Type[Model],
|
|
||||||
bool,
|
|
||||||
ForeignKey,
|
|
||||||
],
|
|
||||||
],
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
Callable,
|
|
||||||
List[
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
Callable,
|
|
||||||
List[
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
Callable,
|
|
||||||
List[
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
Callable,
|
|
||||||
List[Any],
|
|
||||||
List[int],
|
|
||||||
Type[Model],
|
|
||||||
bool,
|
|
||||||
ForeignKey,
|
|
||||||
],
|
|
||||||
]
|
|
||||||
],
|
|
||||||
List[int],
|
|
||||||
Type[Model],
|
|
||||||
bool,
|
|
||||||
ForeignKey,
|
|
||||||
],
|
|
||||||
]
|
|
||||||
],
|
|
||||||
List[int],
|
|
||||||
Type[Model],
|
|
||||||
bool,
|
|
||||||
ForeignKey,
|
|
||||||
],
|
|
||||||
]
|
|
||||||
],
|
|
||||||
List[int],
|
|
||||||
Type[Model],
|
|
||||||
bool,
|
|
||||||
ForeignKey,
|
|
||||||
],
|
|
||||||
],
|
|
||||||
]
|
|
||||||
],
|
|
||||||
]: ...
|
|
||||||
def get_select_for_update_of_arguments(self): ...
|
def get_select_for_update_of_arguments(self): ...
|
||||||
def deferred_to_columns(
|
def deferred_to_columns(self) -> Dict[Type[Model], Set[str]]: ...
|
||||||
self
|
|
||||||
) -> Dict[Type[Model], Union[Set[Any], Set[str]]]: ...
|
|
||||||
def get_converters(
|
def get_converters(
|
||||||
self, expressions: List[Optional[Expression]]
|
self,
|
||||||
) -> Dict[int, Tuple[List[Callable], Expression]]: ...
|
expressions: Union[
|
||||||
|
List[Optional[Expression]], List[SQLiteNumericMixin]
|
||||||
|
],
|
||||||
|
) -> Dict[
|
||||||
|
int, Tuple[List[Callable], Union[Expression, SQLiteNumericMixin]]
|
||||||
|
]: ...
|
||||||
def apply_converters(
|
def apply_converters(
|
||||||
self,
|
self,
|
||||||
rows: chain,
|
rows: chain,
|
||||||
converters: Dict[int, Tuple[List[Callable], Expression]],
|
converters: Dict[
|
||||||
|
int, Tuple[List[Callable], Union[Expression, SQLiteNumericMixin]]
|
||||||
|
],
|
||||||
) -> Iterator[
|
) -> Iterator[
|
||||||
Union[
|
Union[
|
||||||
List[Optional[Union[bool, datetime, str, UUID]]],
|
List[Optional[Union[bool, datetime, str, UUID]]],
|
||||||
@@ -734,10 +199,10 @@ class SQLCompiler:
|
|||||||
List[Optional[Union[bytes, time, int, str]]],
|
List[Optional[Union[bytes, time, int, str]]],
|
||||||
List[Optional[Union[bytes, timedelta, int, str]]],
|
List[Optional[Union[bytes, timedelta, int, str]]],
|
||||||
List[Optional[Union[bytes, Decimal, int, str]]],
|
List[Optional[Union[bytes, Decimal, int, str]]],
|
||||||
List[Optional[Union[bytes, float, int, str]]],
|
List[Optional[Union[bytes, float, str]]],
|
||||||
List[Optional[Union[bytes, int, str, UUID]]],
|
List[Optional[Union[bytes, int, str, UUID]]],
|
||||||
List[Optional[Union[date, time, int, str]]],
|
List[Optional[Union[date, time, int, str]]],
|
||||||
List[Optional[Union[date, Decimal, float, int, str]]],
|
List[Optional[Union[date, Decimal, float, str]]],
|
||||||
List[Union[date, time, timedelta, int, str]],
|
List[Union[date, time, timedelta, int, str]],
|
||||||
List[Union[datetime, time, Decimal, int, str]],
|
List[Union[datetime, time, Decimal, int, str]],
|
||||||
List[Union[timedelta, Decimal, int, str]],
|
List[Union[timedelta, Decimal, int, str]],
|
||||||
@@ -748,49 +213,7 @@ class SQLCompiler:
|
|||||||
self,
|
self,
|
||||||
results: Optional[
|
results: Optional[
|
||||||
Union[
|
Union[
|
||||||
Iterator[Any],
|
Iterator[Any], List[List[Tuple[Union[date, float, int, str]]]]
|
||||||
List[
|
|
||||||
List[
|
|
||||||
Union[
|
|
||||||
Tuple[
|
|
||||||
int,
|
|
||||||
None,
|
|
||||||
str,
|
|
||||||
None,
|
|
||||||
None,
|
|
||||||
None,
|
|
||||||
None,
|
|
||||||
None,
|
|
||||||
None,
|
|
||||||
None,
|
|
||||||
None,
|
|
||||||
None,
|
|
||||||
],
|
|
||||||
Tuple[
|
|
||||||
int,
|
|
||||||
int,
|
|
||||||
str,
|
|
||||||
int,
|
|
||||||
int,
|
|
||||||
str,
|
|
||||||
int,
|
|
||||||
int,
|
|
||||||
str,
|
|
||||||
int,
|
|
||||||
int,
|
|
||||||
str,
|
|
||||||
],
|
|
||||||
]
|
|
||||||
]
|
|
||||||
],
|
|
||||||
List[
|
|
||||||
Union[
|
|
||||||
List[Tuple[Union[date, float, int, str]]],
|
|
||||||
List[
|
|
||||||
Union[Tuple[int, str, None], Tuple[int, str, str]]
|
|
||||||
],
|
|
||||||
]
|
|
||||||
],
|
|
||||||
]
|
]
|
||||||
] = ...,
|
] = ...,
|
||||||
tuple_expected: bool = ...,
|
tuple_expected: bool = ...,
|
||||||
@@ -814,67 +237,50 @@ class SQLInsertCompiler(SQLCompiler):
|
|||||||
def field_as_sql(
|
def field_as_sql(
|
||||||
self,
|
self,
|
||||||
field: Optional[Field],
|
field: Optional[Field],
|
||||||
val: Optional[Union[Lower, float, int, memoryview, str]],
|
val: Optional[Union[Lower, float, memoryview, str]],
|
||||||
) -> Tuple[
|
) -> Tuple[
|
||||||
str,
|
str,
|
||||||
Union[List[None], List[float], List[int], List[memoryview], List[str]],
|
Union[List[None], List[float], List[int], List[memoryview], List[str]],
|
||||||
]: ...
|
]: ...
|
||||||
def prepare_value(
|
def prepare_value(
|
||||||
self,
|
self, field: Field, value: Any
|
||||||
field: Field,
|
) -> Optional[Union[Lower, float, memoryview, str]]: ...
|
||||||
value: Optional[
|
def pre_save_val(self, field: Field, obj: Model) -> Any: ...
|
||||||
Union[
|
|
||||||
Dict[str, Dict[str, List[str]]],
|
|
||||||
bytes,
|
|
||||||
date,
|
|
||||||
time,
|
|
||||||
timedelta,
|
|
||||||
Decimal,
|
|
||||||
Model,
|
|
||||||
SQLiteNumericMixin,
|
|
||||||
files.FieldFile,
|
|
||||||
float,
|
|
||||||
int,
|
|
||||||
memoryview,
|
|
||||||
str,
|
|
||||||
UUID,
|
|
||||||
]
|
|
||||||
],
|
|
||||||
) -> Optional[Union[Lower, float, int, memoryview, str]]: ...
|
|
||||||
def pre_save_val(
|
|
||||||
self, field: Field, obj: Model
|
|
||||||
) -> Optional[
|
|
||||||
Union[
|
|
||||||
Dict[str, Dict[str, List[str]]],
|
|
||||||
bytes,
|
|
||||||
date,
|
|
||||||
time,
|
|
||||||
timedelta,
|
|
||||||
Decimal,
|
|
||||||
Model,
|
|
||||||
SQLiteNumericMixin,
|
|
||||||
files.FieldFile,
|
|
||||||
float,
|
|
||||||
int,
|
|
||||||
memoryview,
|
|
||||||
str,
|
|
||||||
UUID,
|
|
||||||
]
|
|
||||||
]: ...
|
|
||||||
def assemble_as_sql(
|
def assemble_as_sql(
|
||||||
self,
|
self,
|
||||||
fields: Union[List[None], List[Field], ImmutableList],
|
fields: Union[
|
||||||
value_rows: List[
|
List[None], List[DateTimeCheckMixin], List[Field], ImmutableList
|
||||||
Union[
|
|
||||||
List[Optional[Union[Lower, int]]],
|
|
||||||
List[Optional[Union[float, int, memoryview, str]]],
|
|
||||||
]
|
|
||||||
],
|
],
|
||||||
) -> Union[
|
value_rows: Union[
|
||||||
Tuple[List[Any], List[Any]],
|
List[
|
||||||
Tuple[
|
Union[
|
||||||
|
List[Optional[Union[Lower, int]]],
|
||||||
|
List[Optional[Union[int, memoryview, str]]],
|
||||||
|
]
|
||||||
|
],
|
||||||
|
List[
|
||||||
|
Union[
|
||||||
|
List[Optional[Union[float, memoryview, str]]],
|
||||||
|
List[Optional[Union[int, memoryview, str]]],
|
||||||
|
]
|
||||||
|
],
|
||||||
|
],
|
||||||
|
) -> Tuple[
|
||||||
|
Union[
|
||||||
|
List[List[Optional[Union[float, str]]]],
|
||||||
|
List[List[Optional[Union[int, str]]]],
|
||||||
|
List[List[Union[int, memoryview]]],
|
||||||
Tuple[Tuple[str]],
|
Tuple[Tuple[str]],
|
||||||
List[List[Optional[Union[float, int, memoryview, str]]]],
|
],
|
||||||
|
Union[
|
||||||
|
List[List[Optional[Union[float, str]]]],
|
||||||
|
List[List[Optional[Union[int, str]]]],
|
||||||
|
List[
|
||||||
|
Union[
|
||||||
|
List[Optional[Union[float, memoryview, str]]],
|
||||||
|
List[Optional[Union[int, memoryview, str]]],
|
||||||
|
]
|
||||||
|
],
|
||||||
],
|
],
|
||||||
]: ...
|
]: ...
|
||||||
def as_sql(
|
def as_sql(
|
||||||
@@ -886,21 +292,13 @@ class SQLInsertCompiler(SQLCompiler):
|
|||||||
List[Any],
|
List[Any],
|
||||||
List[None],
|
List[None],
|
||||||
List[Optional[Union[bool, str]]],
|
List[Optional[Union[bool, str]]],
|
||||||
List[Optional[Union[bool, str]]],
|
List[Optional[Union[float, str]]],
|
||||||
List[Optional[Union[float, int, str]]],
|
|
||||||
List[Optional[Union[int, memoryview, str]]],
|
List[Optional[Union[int, memoryview, str]]],
|
||||||
List[Optional[Union[int, str]]],
|
List[Optional[Union[int, str]]],
|
||||||
List[Optional[Union[int, str]]],
|
|
||||||
List[Optional[Union[int, str]]],
|
|
||||||
List[Optional[bool]],
|
List[Optional[bool]],
|
||||||
List[Optional[int]],
|
List[Optional[int]],
|
||||||
List[Optional[int]],
|
|
||||||
List[Optional[str]],
|
|
||||||
List[Optional[str]],
|
List[Optional[str]],
|
||||||
List[Union[bool, str]],
|
List[Union[bool, str]],
|
||||||
List[Union[float, int, str]],
|
|
||||||
List[Union[float, int]],
|
|
||||||
List[Union[float, str]],
|
|
||||||
List[Union[float, str]],
|
List[Union[float, str]],
|
||||||
List[Union[int, str]],
|
List[Union[int, str]],
|
||||||
List[bool],
|
List[bool],
|
||||||
@@ -931,4 +329,4 @@ def cursor_iter(
|
|||||||
sentinel: List[Any],
|
sentinel: List[Any],
|
||||||
col_count: Optional[int],
|
col_count: Optional[int],
|
||||||
itersize: int,
|
itersize: int,
|
||||||
) -> Iterator[List[Tuple[Optional[Union[date, float, int, str]]]]]: ...
|
) -> Iterator[List[Tuple[Any]]]: ...
|
||||||
|
|||||||
@@ -1,26 +1,22 @@
|
|||||||
from collections import OrderedDict, namedtuple
|
from collections import OrderedDict, namedtuple
|
||||||
from datetime import date, datetime, time, timedelta
|
from datetime import date, time, timedelta
|
||||||
from decimal import Decimal
|
from decimal import Decimal
|
||||||
from typing import (Any, Callable, Dict, Iterator, List, Optional, Set, Tuple,
|
from typing import (Any, Callable, Dict, Iterator, List, Optional, Set, Tuple,
|
||||||
Type, Union)
|
Type, Union)
|
||||||
from uuid import UUID
|
from uuid import UUID
|
||||||
|
|
||||||
from django.contrib.contenttypes.models import ContentType
|
|
||||||
from django.db.backends.sqlite3.base import DatabaseWrapper
|
from django.db.backends.sqlite3.base import DatabaseWrapper
|
||||||
from django.db.models.aggregates import Aggregate
|
|
||||||
from django.db.models.base import Model, ModelState
|
from django.db.models.base import Model, ModelState
|
||||||
from django.db.models.expressions import (Combinable, CombinedExpression,
|
from django.db.models.expressions import (Combinable, Expression,
|
||||||
Expression, F, SQLiteNumericMixin)
|
SQLiteNumericMixin)
|
||||||
from django.db.models.fields import Field, TextField
|
from django.db.models.fields import Field, TextField
|
||||||
from django.db.models.fields.mixins import FieldCacheMixin
|
from django.db.models.fields.mixins import FieldCacheMixin
|
||||||
from django.db.models.fields.related_lookups import MultiColSource
|
from django.db.models.fields.related_lookups import MultiColSource
|
||||||
from django.db.models.fields.reverse_related import (ForeignObjectRel,
|
from django.db.models.fields.reverse_related import (ForeignObjectRel,
|
||||||
ManyToOneRel)
|
ManyToOneRel)
|
||||||
from django.db.models.functions.datetime import TimezoneMixin
|
|
||||||
from django.db.models.lookups import (FieldGetDbPrepValueMixin, Lookup,
|
from django.db.models.lookups import (FieldGetDbPrepValueMixin, Lookup,
|
||||||
Transform)
|
Transform)
|
||||||
from django.db.models.options import Options
|
from django.db.models.options import Options
|
||||||
from django.db.models.query import QuerySet
|
|
||||||
from django.db.models.query_utils import FilteredRelation, PathInfo, Q
|
from django.db.models.query_utils import FilteredRelation, PathInfo, Q
|
||||||
from django.db.models.sql.compiler import SQLCompiler
|
from django.db.models.sql.compiler import SQLCompiler
|
||||||
from django.db.models.sql.datastructures import BaseTable, Join
|
from django.db.models.sql.datastructures import BaseTable, Join
|
||||||
@@ -47,21 +43,7 @@ class RawQuery:
|
|||||||
cursor: Optional[django.db.backends.utils.CursorWrapper] = ...
|
cursor: Optional[django.db.backends.utils.CursorWrapper] = ...
|
||||||
extra_select: Dict[Any, Any] = ...
|
extra_select: Dict[Any, Any] = ...
|
||||||
annotation_select: Dict[Any, Any] = ...
|
annotation_select: Dict[Any, Any] = ...
|
||||||
def __init__(
|
def __init__(self, sql: str, using: str, params: Any = ...) -> None: ...
|
||||||
self,
|
|
||||||
sql: str,
|
|
||||||
using: str,
|
|
||||||
params: Optional[
|
|
||||||
Union[
|
|
||||||
Dict[str, str],
|
|
||||||
List[datetime],
|
|
||||||
List[Decimal],
|
|
||||||
List[str],
|
|
||||||
Set[str],
|
|
||||||
Tuple[int],
|
|
||||||
]
|
|
||||||
] = ...,
|
|
||||||
) -> None: ...
|
|
||||||
def chain(self, using: str) -> RawQuery: ...
|
def chain(self, using: str) -> RawQuery: ...
|
||||||
def clone(self, using: str) -> RawQuery: ...
|
def clone(self, using: str) -> RawQuery: ...
|
||||||
def get_columns(self) -> List[str]: ...
|
def get_columns(self) -> List[str]: ...
|
||||||
@@ -82,27 +64,12 @@ class Query:
|
|||||||
List[Tuple[django.db.models.fields.IntegerField, None, int]],
|
List[Tuple[django.db.models.fields.IntegerField, None, int]],
|
||||||
],
|
],
|
||||||
]
|
]
|
||||||
values: Union[
|
values: List[
|
||||||
List[
|
Tuple[
|
||||||
Tuple[
|
django.db.models.fields.Field,
|
||||||
django.db.models.fields.CharField,
|
Union[django.db.models.aggregates.Max, int, str],
|
||||||
Type[django.db.models.base.Model],
|
Union[django.db.models.aggregates.Max, int, str],
|
||||||
django.db.models.aggregates.Max,
|
]
|
||||||
]
|
|
||||||
],
|
|
||||||
List[
|
|
||||||
Tuple[
|
|
||||||
django.db.models.fields.IntegerField,
|
|
||||||
Type[django.db.models.base.Model],
|
|
||||||
int,
|
|
||||||
]
|
|
||||||
],
|
|
||||||
List[
|
|
||||||
Union[
|
|
||||||
Tuple[django.db.models.fields.BooleanField, bool, bool],
|
|
||||||
Tuple[django.db.models.fields.CharField, str, str],
|
|
||||||
]
|
|
||||||
],
|
|
||||||
]
|
]
|
||||||
alias_prefix: str = ...
|
alias_prefix: str = ...
|
||||||
subq_aliases: frozenset = ...
|
subq_aliases: frozenset = ...
|
||||||
@@ -172,11 +139,7 @@ class Query:
|
|||||||
int,
|
int,
|
||||||
Union[
|
Union[
|
||||||
Dict[str, Union[ModelState, int, str]],
|
Dict[str, Union[ModelState, int, str]],
|
||||||
List[
|
List[Union[Dict[str, Union[bool, str]], ModelState]],
|
||||||
Union[
|
|
||||||
Dict[Any, Any], Dict[str, Union[bool, str]], ModelState
|
|
||||||
]
|
|
||||||
],
|
|
||||||
Model,
|
Model,
|
||||||
ModelState,
|
ModelState,
|
||||||
],
|
],
|
||||||
@@ -199,13 +162,11 @@ class Query:
|
|||||||
def get_aggregation(
|
def get_aggregation(
|
||||||
self,
|
self,
|
||||||
using: str,
|
using: str,
|
||||||
added_aggregate_names: Union[
|
added_aggregate_names: Union[Dict[str, SQLiteNumericMixin], List[str]],
|
||||||
Dict[str, Union[Aggregate, CombinedExpression]], List[str]
|
|
||||||
],
|
|
||||||
) -> Union[
|
) -> Union[
|
||||||
Dict[str, Optional[int]],
|
Dict[str, Optional[int]],
|
||||||
Dict[str, Union[date, time]],
|
Dict[str, Union[date, time]],
|
||||||
Dict[str, Union[Decimal, float, int]],
|
Dict[str, Union[Decimal, float]],
|
||||||
Dict[str, timedelta],
|
Dict[str, timedelta],
|
||||||
]: ...
|
]: ...
|
||||||
def get_count(self, using: str) -> int: ...
|
def get_count(self, using: str) -> int: ...
|
||||||
@@ -256,70 +217,8 @@ class Query:
|
|||||||
self, compiler: SQLCompiler, connection: DatabaseWrapper
|
self, compiler: SQLCompiler, connection: DatabaseWrapper
|
||||||
) -> Tuple[str, Tuple]: ...
|
) -> Tuple[str, Tuple]: ...
|
||||||
def resolve_lookup_value(
|
def resolve_lookup_value(
|
||||||
self,
|
self, value: Any, can_reuse: Optional[Set[str]], allow_joins: bool
|
||||||
value: Optional[
|
) -> Any: ...
|
||||||
Union[
|
|
||||||
Dict[Any, Any],
|
|
||||||
Iterator[Any],
|
|
||||||
List[Dict[str, str]],
|
|
||||||
List[None],
|
|
||||||
List[Union[List[str], Combinable]],
|
|
||||||
List[Union[Model, int]],
|
|
||||||
List[Union[int, str]],
|
|
||||||
List[datetime],
|
|
||||||
Set[Optional[int]],
|
|
||||||
Set[ContentType],
|
|
||||||
Set[str],
|
|
||||||
Set[UUID],
|
|
||||||
Tuple,
|
|
||||||
bytes,
|
|
||||||
date,
|
|
||||||
timedelta,
|
|
||||||
Decimal,
|
|
||||||
Model,
|
|
||||||
Combinable,
|
|
||||||
QuerySet,
|
|
||||||
Query,
|
|
||||||
float,
|
|
||||||
frozenset,
|
|
||||||
int,
|
|
||||||
range,
|
|
||||||
str,
|
|
||||||
UUID,
|
|
||||||
]
|
|
||||||
],
|
|
||||||
can_reuse: Optional[Set[str]],
|
|
||||||
allow_joins: bool,
|
|
||||||
) -> Optional[
|
|
||||||
Union[
|
|
||||||
Dict[Any, Any],
|
|
||||||
Iterator[Any],
|
|
||||||
List[Dict[str, str]],
|
|
||||||
List[None],
|
|
||||||
List[Union[List[str], Combinable]],
|
|
||||||
List[Union[Model, int]],
|
|
||||||
List[Union[int, str]],
|
|
||||||
List[datetime],
|
|
||||||
Set[Optional[int]],
|
|
||||||
Set[ContentType],
|
|
||||||
Set[str],
|
|
||||||
Set[UUID],
|
|
||||||
Tuple,
|
|
||||||
bytes,
|
|
||||||
date,
|
|
||||||
timedelta,
|
|
||||||
Decimal,
|
|
||||||
Model,
|
|
||||||
Combinable,
|
|
||||||
Query,
|
|
||||||
float,
|
|
||||||
frozenset,
|
|
||||||
int,
|
|
||||||
range,
|
|
||||||
str,
|
|
||||||
UUID,
|
|
||||||
]
|
|
||||||
]: ...
|
|
||||||
def solve_lookup_type(
|
def solve_lookup_type(
|
||||||
self, lookup: str
|
self, lookup: str
|
||||||
) -> Union[
|
) -> Union[
|
||||||
@@ -333,115 +232,18 @@ class Query:
|
|||||||
field: FieldCacheMixin,
|
field: FieldCacheMixin,
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
def check_related_objects(
|
def check_related_objects(
|
||||||
self,
|
self, field: Union[Field, ForeignObjectRel], value: Any, opts: Options
|
||||||
field: Union[Field, ForeignObjectRel],
|
|
||||||
value: Optional[
|
|
||||||
Union[
|
|
||||||
Dict[Any, Any],
|
|
||||||
List[Dict[str, str]],
|
|
||||||
List[None],
|
|
||||||
List[Union[List[str], Combinable]],
|
|
||||||
List[Union[Model, int]],
|
|
||||||
List[Union[int, str]],
|
|
||||||
List[datetime],
|
|
||||||
Set[Optional[int]],
|
|
||||||
Set[ContentType],
|
|
||||||
Set[str],
|
|
||||||
Set[UUID],
|
|
||||||
Tuple,
|
|
||||||
bytes,
|
|
||||||
date,
|
|
||||||
timedelta,
|
|
||||||
Decimal,
|
|
||||||
Model,
|
|
||||||
Combinable,
|
|
||||||
Query,
|
|
||||||
float,
|
|
||||||
frozenset,
|
|
||||||
int,
|
|
||||||
range,
|
|
||||||
str,
|
|
||||||
UUID,
|
|
||||||
]
|
|
||||||
],
|
|
||||||
opts: Options,
|
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
def build_lookup(
|
def build_lookup(
|
||||||
self,
|
self,
|
||||||
lookups: List[str],
|
lookups: List[str],
|
||||||
lhs: Union[Expression, TextField, related_lookups.MultiColSource],
|
lhs: Union[Expression, TextField, related_lookups.MultiColSource],
|
||||||
rhs: Optional[
|
rhs: Any,
|
||||||
Union[
|
|
||||||
Dict[Any, Any],
|
|
||||||
List[Dict[str, str]],
|
|
||||||
List[None],
|
|
||||||
List[Union[List[str], Combinable]],
|
|
||||||
List[Union[Model, int]],
|
|
||||||
List[Union[int, str]],
|
|
||||||
List[datetime],
|
|
||||||
Set[Optional[int]],
|
|
||||||
Set[ContentType],
|
|
||||||
Set[str],
|
|
||||||
Set[UUID],
|
|
||||||
Tuple,
|
|
||||||
bytes,
|
|
||||||
date,
|
|
||||||
timedelta,
|
|
||||||
Decimal,
|
|
||||||
Model,
|
|
||||||
Combinable,
|
|
||||||
Query,
|
|
||||||
float,
|
|
||||||
frozenset,
|
|
||||||
int,
|
|
||||||
range,
|
|
||||||
str,
|
|
||||||
UUID,
|
|
||||||
]
|
|
||||||
],
|
|
||||||
) -> Lookup: ...
|
) -> Lookup: ...
|
||||||
def try_transform(self, lhs: Expression, name: str) -> Transform: ...
|
def try_transform(self, lhs: Expression, name: str) -> Transform: ...
|
||||||
def build_filter(
|
def build_filter(
|
||||||
self,
|
self,
|
||||||
filter_expr: Union[
|
filter_expr: Union[Dict[str, str], Tuple[str, Any]],
|
||||||
Dict[str, str],
|
|
||||||
Tuple[
|
|
||||||
str,
|
|
||||||
Optional[
|
|
||||||
Union[
|
|
||||||
Dict[Any, Any],
|
|
||||||
Iterator[Any],
|
|
||||||
List[Dict[str, str]],
|
|
||||||
List[List[str]],
|
|
||||||
List[None],
|
|
||||||
List[Union[Model, int]],
|
|
||||||
List[Union[int, str]],
|
|
||||||
List[datetime],
|
|
||||||
List[Combinable],
|
|
||||||
Set[Optional[int]],
|
|
||||||
Set[ContentType],
|
|
||||||
Set[str],
|
|
||||||
Set[UUID],
|
|
||||||
Tuple,
|
|
||||||
bytes,
|
|
||||||
date,
|
|
||||||
timedelta,
|
|
||||||
Decimal,
|
|
||||||
Model,
|
|
||||||
Combinable,
|
|
||||||
django.db.models.functions.TimezoneMixin,
|
|
||||||
QuerySet,
|
|
||||||
Query,
|
|
||||||
float,
|
|
||||||
frozenset,
|
|
||||||
int,
|
|
||||||
range,
|
|
||||||
str,
|
|
||||||
UUID,
|
|
||||||
]
|
|
||||||
],
|
|
||||||
],
|
|
||||||
],
|
|
||||||
branch_negated: bool = ...,
|
branch_negated: bool = ...,
|
||||||
current_negated: bool = ...,
|
current_negated: bool = ...,
|
||||||
can_reuse: Optional[Set[str]] = ...,
|
can_reuse: Optional[Set[str]] = ...,
|
||||||
@@ -449,26 +251,7 @@ class Query:
|
|||||||
split_subq: bool = ...,
|
split_subq: bool = ...,
|
||||||
reuse_with_filtered_relation: bool = ...,
|
reuse_with_filtered_relation: bool = ...,
|
||||||
) -> Tuple[WhereNode, Union[List[Any], Set[str], Tuple]]: ...
|
) -> Tuple[WhereNode, Union[List[Any], Set[str], Tuple]]: ...
|
||||||
def add_filter(
|
def add_filter(self, filter_clause: Tuple[str, Any]) -> None: ...
|
||||||
self,
|
|
||||||
filter_clause: Tuple[
|
|
||||||
str,
|
|
||||||
Optional[
|
|
||||||
Union[
|
|
||||||
List[Model],
|
|
||||||
List[int],
|
|
||||||
List[str],
|
|
||||||
Tuple[str, str],
|
|
||||||
Model,
|
|
||||||
F,
|
|
||||||
QuerySet,
|
|
||||||
Query,
|
|
||||||
int,
|
|
||||||
str,
|
|
||||||
]
|
|
||||||
],
|
|
||||||
],
|
|
||||||
) -> None: ...
|
|
||||||
def add_q(self, q_object: Q) -> None: ...
|
def add_q(self, q_object: Q) -> None: ...
|
||||||
def build_filtered_relation_q(
|
def build_filtered_relation_q(
|
||||||
self,
|
self,
|
||||||
@@ -487,8 +270,10 @@ class Query:
|
|||||||
allow_many: bool = ...,
|
allow_many: bool = ...,
|
||||||
fail_on_missing: bool = ...,
|
fail_on_missing: bool = ...,
|
||||||
) -> Union[
|
) -> Union[
|
||||||
Tuple[List[PathInfo], Tuple[Field], List[str], List[str]],
|
Tuple[
|
||||||
Tuple[List[PathInfo], ForeignObjectRel, Tuple[Field], List[str]],
|
List[PathInfo], Tuple[Field], List[str], Union[List[Any], List[str]]
|
||||||
|
],
|
||||||
|
Tuple[List[PathInfo], Field, Tuple[Field], List[str]],
|
||||||
]: ...
|
]: ...
|
||||||
def setup_joins(
|
def setup_joins(
|
||||||
self,
|
self,
|
||||||
@@ -511,21 +296,7 @@ class Query:
|
|||||||
) -> Expression: ...
|
) -> Expression: ...
|
||||||
def split_exclude(
|
def split_exclude(
|
||||||
self,
|
self,
|
||||||
filter_expr: Tuple[
|
filter_expr: Tuple[str, Any],
|
||||||
str,
|
|
||||||
Optional[
|
|
||||||
Union[
|
|
||||||
List[Model],
|
|
||||||
List[str],
|
|
||||||
Tuple[str, str],
|
|
||||||
Model,
|
|
||||||
F,
|
|
||||||
QuerySet,
|
|
||||||
int,
|
|
||||||
str,
|
|
||||||
]
|
|
||||||
],
|
|
||||||
],
|
|
||||||
can_reuse: Set[str],
|
can_reuse: Set[str],
|
||||||
names_with_path: List[Tuple[str, List[PathInfo]]],
|
names_with_path: List[Tuple[str, List[PathInfo]]],
|
||||||
) -> Tuple[WhereNode, Tuple]: ...
|
) -> Tuple[WhereNode, Tuple]: ...
|
||||||
@@ -564,12 +335,10 @@ class Query:
|
|||||||
def clear_deferred_loading(self) -> None: ...
|
def clear_deferred_loading(self) -> None: ...
|
||||||
def add_deferred_loading(self, field_names: Tuple[str]) -> None: ...
|
def add_deferred_loading(self, field_names: Tuple[str]) -> None: ...
|
||||||
def add_immediate_loading(self, field_names: Tuple[str]) -> None: ...
|
def add_immediate_loading(self, field_names: Tuple[str]) -> None: ...
|
||||||
def get_loaded_field_names(
|
def get_loaded_field_names(self) -> Dict[Type[Model], Set[str]]: ...
|
||||||
self
|
|
||||||
) -> Dict[Type[Model], Union[Set[Any], Set[str]]]: ...
|
|
||||||
def get_loaded_field_names_cb(
|
def get_loaded_field_names_cb(
|
||||||
self,
|
self,
|
||||||
target: Dict[Type[Model], Union[Set[Any], Set[str]]],
|
target: Dict[Type[Model], Set[str]],
|
||||||
model: Type[Model],
|
model: Type[Model],
|
||||||
fields: Union[Set[Field], Set[ManyToOneRel]],
|
fields: Union[Set[Field], Set[ManyToOneRel]],
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
|
|||||||
@@ -1,12 +1,10 @@
|
|||||||
from datetime import date, datetime, time
|
from datetime import datetime
|
||||||
from decimal import Decimal
|
|
||||||
from typing import Any, Dict, List, Optional, Tuple, Type, Union
|
from typing import Any, Dict, List, Optional, Tuple, Type, Union
|
||||||
from uuid import UUID
|
from uuid import UUID
|
||||||
|
|
||||||
from django.db.models.base import Model
|
from django.db.models.base import Model
|
||||||
from django.db.models.expressions import Combinable
|
from django.db.models.expressions import Combinable
|
||||||
from django.db.models.fields import Field
|
from django.db.models.fields import DateTimeCheckMixin, Field
|
||||||
from django.db.models.fields.files import FieldFile
|
|
||||||
from django.db.models.query import QuerySet
|
from django.db.models.query import QuerySet
|
||||||
from django.db.models.sql.query import Query
|
from django.db.models.sql.query import Query
|
||||||
from django.db.models.sql.where import WhereNode
|
from django.db.models.sql.where import WhereNode
|
||||||
@@ -110,43 +108,7 @@ class UpdateQuery(Query):
|
|||||||
subquery: bool
|
subquery: bool
|
||||||
table_map: Dict[str, List[str]]
|
table_map: Dict[str, List[str]]
|
||||||
used_aliases: Set[str]
|
used_aliases: Set[str]
|
||||||
values: List[
|
values: List[Tuple[django.db.models.fields.Field, Any, Any]]
|
||||||
Tuple[
|
|
||||||
django.db.models.fields.Field,
|
|
||||||
Optional[
|
|
||||||
Union[
|
|
||||||
bytes,
|
|
||||||
datetime.date,
|
|
||||||
datetime.time,
|
|
||||||
decimal.Decimal,
|
|
||||||
django.db.models.base.Model,
|
|
||||||
django.db.models.expressions.Expression,
|
|
||||||
django.db.models.fields.files.FieldFile,
|
|
||||||
float,
|
|
||||||
int,
|
|
||||||
memoryview,
|
|
||||||
str,
|
|
||||||
uuid.UUID,
|
|
||||||
]
|
|
||||||
],
|
|
||||||
Optional[
|
|
||||||
Union[
|
|
||||||
bytes,
|
|
||||||
datetime.date,
|
|
||||||
datetime.time,
|
|
||||||
decimal.Decimal,
|
|
||||||
django.db.models.base.Model,
|
|
||||||
django.db.models.expressions.Expression,
|
|
||||||
django.db.models.fields.files.FieldFile,
|
|
||||||
float,
|
|
||||||
int,
|
|
||||||
memoryview,
|
|
||||||
str,
|
|
||||||
uuid.UUID,
|
|
||||||
]
|
|
||||||
],
|
|
||||||
]
|
|
||||||
]
|
|
||||||
values_select: Tuple
|
values_select: Tuple
|
||||||
where_class: Type[django.db.models.sql.where.WhereNode]
|
where_class: Type[django.db.models.sql.where.WhereNode]
|
||||||
compiler: str = ...
|
compiler: str = ...
|
||||||
@@ -171,44 +133,7 @@ class UpdateQuery(Query):
|
|||||||
],
|
],
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
def add_update_fields(
|
def add_update_fields(
|
||||||
self,
|
self, values_seq: List[Tuple[Field, Any, Any]]
|
||||||
values_seq: List[
|
|
||||||
Tuple[
|
|
||||||
Field,
|
|
||||||
Optional[
|
|
||||||
Union[
|
|
||||||
Type[Model],
|
|
||||||
date,
|
|
||||||
time,
|
|
||||||
Decimal,
|
|
||||||
Model,
|
|
||||||
Combinable,
|
|
||||||
files.FieldFile,
|
|
||||||
float,
|
|
||||||
int,
|
|
||||||
memoryview,
|
|
||||||
str,
|
|
||||||
UUID,
|
|
||||||
]
|
|
||||||
],
|
|
||||||
Optional[
|
|
||||||
Union[
|
|
||||||
bytes,
|
|
||||||
date,
|
|
||||||
time,
|
|
||||||
Decimal,
|
|
||||||
Model,
|
|
||||||
Combinable,
|
|
||||||
files.FieldFile,
|
|
||||||
float,
|
|
||||||
int,
|
|
||||||
memoryview,
|
|
||||||
str,
|
|
||||||
UUID,
|
|
||||||
]
|
|
||||||
],
|
|
||||||
]
|
|
||||||
],
|
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
def add_related_update(
|
def add_related_update(
|
||||||
self, model: Type[Model], field: Field, value: Union[int, str]
|
self, model: Type[Model], field: Field, value: Union[int, str]
|
||||||
@@ -256,6 +181,7 @@ class InsertQuery(Query):
|
|||||||
where_class: Type[django.db.models.sql.where.WhereNode]
|
where_class: Type[django.db.models.sql.where.WhereNode]
|
||||||
compiler: str = ...
|
compiler: str = ...
|
||||||
fields: Union[
|
fields: Union[
|
||||||
|
List[django.db.models.fields.DateTimeCheckMixin],
|
||||||
List[django.db.models.fields.Field],
|
List[django.db.models.fields.Field],
|
||||||
django.utils.datastructures.ImmutableList,
|
django.utils.datastructures.ImmutableList,
|
||||||
] = ...
|
] = ...
|
||||||
@@ -264,7 +190,7 @@ class InsertQuery(Query):
|
|||||||
raw: bool = ...
|
raw: bool = ...
|
||||||
def insert_values(
|
def insert_values(
|
||||||
self,
|
self,
|
||||||
fields: Union[List[Field], ImmutableList],
|
fields: Union[List[DateTimeCheckMixin], List[Field], ImmutableList],
|
||||||
objs: List[Model],
|
objs: List[Model],
|
||||||
raw: bool = ...,
|
raw: bool = ...,
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
|
|||||||
@@ -34,8 +34,8 @@ class WhereNode(tree.Node):
|
|||||||
List[Optional[int]],
|
List[Optional[int]],
|
||||||
List[Union[date, str]],
|
List[Union[date, str]],
|
||||||
List[Union[Decimal, int]],
|
List[Union[Decimal, int]],
|
||||||
List[Union[float, int]],
|
|
||||||
List[Union[int, str]],
|
List[Union[int, str]],
|
||||||
|
List[float],
|
||||||
List[memoryview],
|
List[memoryview],
|
||||||
],
|
],
|
||||||
]: ...
|
]: ...
|
||||||
@@ -50,24 +50,53 @@ class WhereNode(tree.Node):
|
|||||||
],
|
],
|
||||||
List[
|
List[
|
||||||
Union[
|
Union[
|
||||||
django.db.models.lookups.FieldGetDbPrepValueMixin,
|
django.db.models.lookups.BuiltinLookup,
|
||||||
django.db.models.lookups.Lookup,
|
|
||||||
django.db.models.sql.where.NothingNode,
|
|
||||||
django.db.models.sql.where.WhereNode,
|
django.db.models.sql.where.WhereNode,
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
|
List[
|
||||||
|
Union[
|
||||||
|
django.db.models.lookups.FieldGetDbPrepValueMixin,
|
||||||
|
django.db.models.lookups.IsNull,
|
||||||
|
]
|
||||||
|
],
|
||||||
List[
|
List[
|
||||||
Union[
|
Union[
|
||||||
django.db.models.lookups.FieldGetDbPrepValueMixin,
|
django.db.models.lookups.FieldGetDbPrepValueMixin,
|
||||||
django.db.models.query_utils.QueryWrapper,
|
django.db.models.query_utils.QueryWrapper,
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
|
List[
|
||||||
|
Union[
|
||||||
|
django.db.models.lookups.FieldGetDbPrepValueMixin,
|
||||||
|
django.db.models.sql.where.NothingNode,
|
||||||
|
]
|
||||||
|
],
|
||||||
|
List[
|
||||||
|
Union[
|
||||||
|
django.db.models.lookups.FieldGetDbPrepValueMixin,
|
||||||
|
django.db.models.sql.where.WhereNode,
|
||||||
|
]
|
||||||
|
],
|
||||||
|
List[
|
||||||
|
Union[
|
||||||
|
django.db.models.lookups.Lookup,
|
||||||
|
django.db.models.sql.where.NothingNode,
|
||||||
|
]
|
||||||
|
],
|
||||||
|
List[
|
||||||
|
Union[
|
||||||
|
django.db.models.sql.where.NothingNode,
|
||||||
|
django.db.models.sql.where.WhereNode,
|
||||||
|
]
|
||||||
|
],
|
||||||
List[
|
List[
|
||||||
Union[
|
Union[
|
||||||
django.db.models.sql.where.SubqueryConstraint,
|
django.db.models.sql.where.SubqueryConstraint,
|
||||||
django.db.models.sql.where.WhereNode,
|
django.db.models.sql.where.WhereNode,
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
|
List[django.db.models.fields.related_lookups.RelatedLookupMixin],
|
||||||
] = ...
|
] = ...
|
||||||
def set_source_expressions(
|
def set_source_expressions(
|
||||||
self, children: List[FieldGetDbPrepValueMixin]
|
self, children: List[FieldGetDbPrepValueMixin]
|
||||||
|
|||||||
@@ -35,30 +35,10 @@ class ConnectionDoesNotExist(Exception): ...
|
|||||||
class ConnectionHandler:
|
class ConnectionHandler:
|
||||||
databases: Union[
|
databases: Union[
|
||||||
Dict[
|
Dict[
|
||||||
str,
|
str, Dict[str, Optional[Union[Dict[str, Optional[bool]], int, str]]]
|
||||||
Dict[
|
|
||||||
str, Optional[Union[Dict[Any, Any], Dict[str, bool], int, str]]
|
|
||||||
],
|
|
||||||
],
|
],
|
||||||
Dict[
|
Dict[
|
||||||
str,
|
str, Dict[str, Optional[Union[Dict[str, Optional[str]], int, str]]]
|
||||||
Union[
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Optional[Union[Dict[Any, Any], Dict[str, None], int, str]],
|
|
||||||
],
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Optional[
|
|
||||||
Union[
|
|
||||||
Dict[str, Optional[bool]],
|
|
||||||
Dict[str, Optional[str]],
|
|
||||||
int,
|
|
||||||
str,
|
|
||||||
]
|
|
||||||
],
|
|
||||||
],
|
|
||||||
],
|
|
||||||
],
|
],
|
||||||
]
|
]
|
||||||
def __init__(
|
def __init__(
|
||||||
|
|||||||
@@ -1,12 +1,7 @@
|
|||||||
from typing import Any, Callable, List, Optional, Tuple, Type, Union
|
from typing import Any, Callable, List, Optional, Tuple, Type, Union
|
||||||
|
|
||||||
from django.apps.config import AppConfig
|
from django.apps.config import AppConfig
|
||||||
from django.conf import Settings, UserSettingsHolder
|
|
||||||
from django.core.handlers.wsgi import WSGIHandler
|
|
||||||
from django.db.backends.sqlite3.base import DatabaseWrapper
|
|
||||||
from django.db.models.base import Model
|
from django.db.models.base import Model
|
||||||
from django.template.base import Template
|
|
||||||
from django.test.client import ClientHandler
|
|
||||||
from django.test.testcases import SimpleTestCase
|
from django.test.testcases import SimpleTestCase
|
||||||
|
|
||||||
NONE_ID: Any
|
NONE_ID: Any
|
||||||
@@ -24,46 +19,20 @@ class Signal:
|
|||||||
def connect(
|
def connect(
|
||||||
self,
|
self,
|
||||||
receiver: Any,
|
receiver: Any,
|
||||||
sender: Optional[
|
sender: Optional[Union[Type[Model], AppConfig, SimpleTestCase]] = ...,
|
||||||
Union[Type[Union[Any, Model]], AppConfig, SimpleTestCase]
|
|
||||||
] = ...,
|
|
||||||
weak: bool = ...,
|
weak: bool = ...,
|
||||||
dispatch_uid: Optional[str] = ...,
|
dispatch_uid: Optional[str] = ...,
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
def disconnect(
|
def disconnect(
|
||||||
self,
|
self,
|
||||||
receiver: Optional[Callable] = ...,
|
receiver: Optional[Callable] = ...,
|
||||||
sender: Optional[
|
sender: Optional[Union[Type[Model], AppConfig, SimpleTestCase]] = ...,
|
||||||
Union[Type[Union[Any, Model]], AppConfig, SimpleTestCase]
|
|
||||||
] = ...,
|
|
||||||
dispatch_uid: Optional[str] = ...,
|
dispatch_uid: Optional[str] = ...,
|
||||||
) -> bool: ...
|
) -> bool: ...
|
||||||
def has_listeners(self, sender: Any = ...) -> bool: ...
|
def has_listeners(self, sender: Any = ...) -> bool: ...
|
||||||
def send(
|
def send(
|
||||||
self,
|
self, sender: Any, **named: Any
|
||||||
sender: Optional[
|
) -> Union[List[Tuple[None, None]], List[Tuple[str, str]]]: ...
|
||||||
Union[
|
|
||||||
Type[
|
|
||||||
Optional[
|
|
||||||
Union[
|
|
||||||
Settings,
|
|
||||||
UserSettingsHolder,
|
|
||||||
WSGIHandler,
|
|
||||||
DatabaseWrapper,
|
|
||||||
Model,
|
|
||||||
ClientHandler,
|
|
||||||
SimpleTestCase,
|
|
||||||
]
|
|
||||||
]
|
|
||||||
],
|
|
||||||
AppConfig,
|
|
||||||
Template,
|
|
||||||
SimpleTestCase,
|
|
||||||
str,
|
|
||||||
]
|
|
||||||
],
|
|
||||||
**named: Any
|
|
||||||
) -> List[Tuple[Optional[str], Optional[str]]]: ...
|
|
||||||
def send_robust(
|
def send_robust(
|
||||||
self, sender: SimpleTestCase, **named: Any
|
self, sender: SimpleTestCase, **named: Any
|
||||||
) -> List[Tuple[Callable, Union[ValueError, str]]]: ...
|
) -> List[Tuple[Callable, Union[ValueError, str]]]: ...
|
||||||
|
|||||||
@@ -1,12 +1,5 @@
|
|||||||
from datetime import date, time, timedelta
|
|
||||||
from decimal import Decimal
|
|
||||||
from typing import Any, Dict, List, Optional, Union
|
from typing import Any, Dict, List, Optional, Union
|
||||||
from uuid import UUID
|
|
||||||
|
|
||||||
from django.core.files.base import File
|
|
||||||
from django.db.models.base import Model
|
|
||||||
from django.db.models.fields.files import FieldFile
|
|
||||||
from django.db.models.query import QuerySet
|
|
||||||
from django.forms.fields import Field
|
from django.forms.fields import Field
|
||||||
from django.forms.forms import BaseForm
|
from django.forms.forms import BaseForm
|
||||||
from django.forms.renderers import DjangoTemplates
|
from django.forms.renderers import DjangoTemplates
|
||||||
@@ -16,18 +9,7 @@ from django.utils.safestring import SafeText
|
|||||||
|
|
||||||
|
|
||||||
class BoundField:
|
class BoundField:
|
||||||
initial: Optional[
|
initial: Any
|
||||||
Union[
|
|
||||||
List[django.db.models.base.Model],
|
|
||||||
List[int],
|
|
||||||
List[str],
|
|
||||||
datetime.date,
|
|
||||||
django.db.models.base.Model,
|
|
||||||
django.db.models.query.QuerySet,
|
|
||||||
int,
|
|
||||||
str,
|
|
||||||
]
|
|
||||||
]
|
|
||||||
form: django.forms.forms.BaseForm = ...
|
form: django.forms.forms.BaseForm = ...
|
||||||
field: django.forms.fields.Field = ...
|
field: django.forms.fields.Field = ...
|
||||||
name: str = ...
|
name: str = ...
|
||||||
@@ -57,22 +39,7 @@ class BoundField:
|
|||||||
def as_hidden(self, attrs: None = ..., **kwargs: Any) -> SafeText: ...
|
def as_hidden(self, attrs: None = ..., **kwargs: Any) -> SafeText: ...
|
||||||
@property
|
@property
|
||||||
def data(self) -> Any: ...
|
def data(self) -> Any: ...
|
||||||
def value(
|
def value(self) -> Any: ...
|
||||||
self
|
|
||||||
) -> Optional[
|
|
||||||
Union[
|
|
||||||
List[Union[List[str], str]],
|
|
||||||
List[int],
|
|
||||||
date,
|
|
||||||
time,
|
|
||||||
Decimal,
|
|
||||||
File,
|
|
||||||
float,
|
|
||||||
int,
|
|
||||||
str,
|
|
||||||
UUID,
|
|
||||||
]
|
|
||||||
]: ...
|
|
||||||
def label_tag(
|
def label_tag(
|
||||||
self,
|
self,
|
||||||
contents: Optional[str] = ...,
|
contents: Optional[str] = ...,
|
||||||
@@ -86,24 +53,7 @@ class BoundField:
|
|||||||
def auto_id(self) -> str: ...
|
def auto_id(self) -> str: ...
|
||||||
@property
|
@property
|
||||||
def id_for_label(self) -> str: ...
|
def id_for_label(self) -> str: ...
|
||||||
def initial(
|
def initial(self) -> Any: ...
|
||||||
self
|
|
||||||
) -> Optional[
|
|
||||||
Union[
|
|
||||||
List[Union[int, str]],
|
|
||||||
List[Model],
|
|
||||||
date,
|
|
||||||
time,
|
|
||||||
timedelta,
|
|
||||||
Model,
|
|
||||||
FieldFile,
|
|
||||||
QuerySet,
|
|
||||||
float,
|
|
||||||
int,
|
|
||||||
str,
|
|
||||||
UUID,
|
|
||||||
]
|
|
||||||
]: ...
|
|
||||||
def build_widget_attrs(
|
def build_widget_attrs(
|
||||||
self, attrs: Dict[str, str], widget: Optional[Widget] = ...
|
self, attrs: Dict[str, str], widget: Optional[Widget] = ...
|
||||||
) -> Dict[str, Union[bool, str]]: ...
|
) -> Dict[str, Union[bool, str]]: ...
|
||||||
|
|||||||
+44
-442
@@ -4,27 +4,12 @@ from decimal import Decimal
|
|||||||
from typing import Any, Callable, Dict, List, Optional, Tuple, Union
|
from typing import Any, Callable, Dict, List, Optional, Tuple, Union
|
||||||
from uuid import UUID
|
from uuid import UUID
|
||||||
|
|
||||||
from django.contrib.admin.widgets import (AdminEmailInputWidget,
|
|
||||||
AdminIntegerFieldWidget,
|
|
||||||
AdminSplitDateTime,
|
|
||||||
AdminTextareaWidget,
|
|
||||||
AdminTextInputWidget,
|
|
||||||
AdminURLFieldWidget,
|
|
||||||
RelatedFieldWidgetWrapper)
|
|
||||||
from django.contrib.auth.forms import (ReadOnlyPasswordHashField,
|
|
||||||
ReadOnlyPasswordHashWidget)
|
|
||||||
from django.core.files.base import File
|
from django.core.files.base import File
|
||||||
from django.core.files.uploadedfile import SimpleUploadedFile
|
from django.core.files.uploadedfile import SimpleUploadedFile
|
||||||
from django.db.models.base import Model
|
|
||||||
from django.db.models.fields.files import FieldFile
|
from django.db.models.fields.files import FieldFile
|
||||||
from django.forms.boundfield import BoundField
|
from django.forms.boundfield import BoundField
|
||||||
from django.forms.forms import BaseForm
|
from django.forms.forms import BaseForm
|
||||||
from django.forms.models import ModelChoiceField
|
from django.forms.widgets import Input, Select, Widget
|
||||||
from django.forms.widgets import (CheckboxInput, ClearableFileInput,
|
|
||||||
EmailInput, HiddenInput, Input, MultiWidget,
|
|
||||||
NumberInput, PasswordInput, RadioSelect,
|
|
||||||
Select, SplitDateTimeWidget, Textarea,
|
|
||||||
TextInput, Widget)
|
|
||||||
|
|
||||||
|
|
||||||
class Field:
|
class Field:
|
||||||
@@ -58,125 +43,14 @@ class Field:
|
|||||||
disabled: bool = ...,
|
disabled: bool = ...,
|
||||||
label_suffix: Optional[Any] = ...
|
label_suffix: Optional[Any] = ...
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
def prepare_value(
|
def prepare_value(self, value: Any) -> Any: ...
|
||||||
self,
|
def to_python(self, value: Any) -> Any: ...
|
||||||
value: Optional[
|
def validate(self, value: Any) -> None: ...
|
||||||
Union[
|
def run_validators(self, value: Any) -> None: ...
|
||||||
Dict[str, str],
|
def clean(self, value: Any) -> Any: ...
|
||||||
List[Union[List[str], str]],
|
def bound_data(self, data: Any, initial: Any) -> Any: ...
|
||||||
date,
|
|
||||||
time,
|
|
||||||
Decimal,
|
|
||||||
File,
|
|
||||||
float,
|
|
||||||
int,
|
|
||||||
str,
|
|
||||||
UUID,
|
|
||||||
]
|
|
||||||
],
|
|
||||||
) -> Optional[
|
|
||||||
Union[
|
|
||||||
Dict[str, str],
|
|
||||||
List[Union[List[str], str]],
|
|
||||||
date,
|
|
||||||
time,
|
|
||||||
Decimal,
|
|
||||||
File,
|
|
||||||
float,
|
|
||||||
int,
|
|
||||||
str,
|
|
||||||
UUID,
|
|
||||||
]
|
|
||||||
]: ...
|
|
||||||
def to_python(
|
|
||||||
self,
|
|
||||||
value: Optional[
|
|
||||||
Union[List[None], List[str], datetime, float, int, str]
|
|
||||||
],
|
|
||||||
) -> Optional[Union[List[None], List[str], datetime, float, int, str]]: ...
|
|
||||||
def validate(
|
|
||||||
self,
|
|
||||||
value: Optional[
|
|
||||||
Union[
|
|
||||||
date,
|
|
||||||
time,
|
|
||||||
timedelta,
|
|
||||||
Decimal,
|
|
||||||
SimpleUploadedFile,
|
|
||||||
Model,
|
|
||||||
float,
|
|
||||||
int,
|
|
||||||
str,
|
|
||||||
UUID,
|
|
||||||
]
|
|
||||||
],
|
|
||||||
) -> None: ...
|
|
||||||
def run_validators(
|
|
||||||
self,
|
|
||||||
value: Optional[
|
|
||||||
Union[
|
|
||||||
List[Union[int, str]],
|
|
||||||
date,
|
|
||||||
time,
|
|
||||||
timedelta,
|
|
||||||
Decimal,
|
|
||||||
SimpleUploadedFile,
|
|
||||||
Model,
|
|
||||||
float,
|
|
||||||
int,
|
|
||||||
str,
|
|
||||||
UUID,
|
|
||||||
]
|
|
||||||
],
|
|
||||||
) -> None: ...
|
|
||||||
def clean(
|
|
||||||
self,
|
|
||||||
value: Optional[
|
|
||||||
Union[
|
|
||||||
Dict[Any, Any],
|
|
||||||
List[Dict[str, str]],
|
|
||||||
List[List[str]],
|
|
||||||
List[Union[int, str]],
|
|
||||||
Tuple,
|
|
||||||
date,
|
|
||||||
time,
|
|
||||||
Decimal,
|
|
||||||
SimpleUploadedFile,
|
|
||||||
float,
|
|
||||||
int,
|
|
||||||
str,
|
|
||||||
]
|
|
||||||
],
|
|
||||||
) -> Optional[
|
|
||||||
Union[
|
|
||||||
List[str],
|
|
||||||
date,
|
|
||||||
time,
|
|
||||||
timedelta,
|
|
||||||
Decimal,
|
|
||||||
SimpleUploadedFile,
|
|
||||||
Model,
|
|
||||||
float,
|
|
||||||
int,
|
|
||||||
str,
|
|
||||||
UUID,
|
|
||||||
]
|
|
||||||
]: ...
|
|
||||||
def bound_data(
|
|
||||||
self,
|
|
||||||
data: Optional[
|
|
||||||
Union[List[Union[List[str], str]], datetime, Decimal, int, str]
|
|
||||||
],
|
|
||||||
initial: Optional[Union[List[str], date, float, int, str, UUID]],
|
|
||||||
) -> Optional[
|
|
||||||
Union[List[Union[List[str], str]], date, Decimal, int, str]
|
|
||||||
]: ...
|
|
||||||
def widget_attrs(self, widget: Widget) -> Dict[Any, Any]: ...
|
def widget_attrs(self, widget: Widget) -> Dict[Any, Any]: ...
|
||||||
def has_changed(
|
def has_changed(self, initial: Any, data: Optional[str]) -> bool: ...
|
||||||
self,
|
|
||||||
initial: Optional[Union[date, time, Decimal, float, int, str]],
|
|
||||||
data: Optional[str],
|
|
||||||
) -> bool: ...
|
|
||||||
def get_bound_field(
|
def get_bound_field(
|
||||||
self, form: BaseForm, field_name: str
|
self, form: BaseForm, field_name: str
|
||||||
) -> BoundField: ...
|
) -> BoundField: ...
|
||||||
@@ -187,34 +61,7 @@ class Field:
|
|||||||
int,
|
int,
|
||||||
Union[
|
Union[
|
||||||
List[Tuple[str, str]],
|
List[Tuple[str, str]],
|
||||||
List[
|
List[Union[List[Tuple[str, str]], Field, Widget]],
|
||||||
Union[
|
|
||||||
List[Tuple[str, str]],
|
|
||||||
CharField,
|
|
||||||
ChoiceField,
|
|
||||||
IntegerField,
|
|
||||||
EmailInput,
|
|
||||||
NumberInput,
|
|
||||||
Select,
|
|
||||||
TextInput,
|
|
||||||
]
|
|
||||||
],
|
|
||||||
List[
|
|
||||||
Union[
|
|
||||||
CharField,
|
|
||||||
DateField,
|
|
||||||
EmailInput,
|
|
||||||
PasswordInput,
|
|
||||||
TextInput,
|
|
||||||
]
|
|
||||||
],
|
|
||||||
List[
|
|
||||||
Union[CharField, DateTimeField, DecimalField, TextInput]
|
|
||||||
],
|
|
||||||
List[Union[CharField, HiddenInput, TextInput]],
|
|
||||||
List[
|
|
||||||
Union[DateTimeField, TimeField, HiddenInput, TextInput]
|
|
||||||
],
|
|
||||||
OrderedDict,
|
OrderedDict,
|
||||||
Field,
|
Field,
|
||||||
Widget,
|
Widget,
|
||||||
@@ -223,176 +70,10 @@ class Field:
|
|||||||
Dict[
|
Dict[
|
||||||
int,
|
int,
|
||||||
Union[
|
Union[
|
||||||
List[Tuple[str, str]],
|
List[Union[List[Any], ChoiceField, Select]],
|
||||||
List[
|
|
||||||
Union[
|
|
||||||
List[Tuple[str, str]],
|
|
||||||
CharField,
|
|
||||||
DateField,
|
|
||||||
TypedChoiceField,
|
|
||||||
Select,
|
|
||||||
TextInput,
|
|
||||||
]
|
|
||||||
],
|
|
||||||
List[
|
|
||||||
Union[
|
|
||||||
AdminIntegerFieldWidget,
|
|
||||||
RelatedFieldWidgetWrapper,
|
|
||||||
IntegerField,
|
|
||||||
ModelChoiceField,
|
|
||||||
Select,
|
|
||||||
]
|
|
||||||
],
|
|
||||||
List[
|
|
||||||
Union[
|
|
||||||
BooleanField,
|
|
||||||
CharField,
|
|
||||||
CheckboxInput,
|
|
||||||
TextInput,
|
|
||||||
Textarea,
|
|
||||||
]
|
|
||||||
],
|
|
||||||
List[Union[NullBooleanField, RadioSelect]],
|
|
||||||
OrderedDict,
|
OrderedDict,
|
||||||
Field,
|
ChoiceField,
|
||||||
Widget,
|
Select,
|
||||||
],
|
|
||||||
],
|
|
||||||
Dict[
|
|
||||||
int,
|
|
||||||
Union[
|
|
||||||
List[
|
|
||||||
Union[
|
|
||||||
List[Any],
|
|
||||||
List[Union[Tuple[int, str], Tuple[str, str]]],
|
|
||||||
AdminSplitDateTime,
|
|
||||||
RelatedFieldWidgetWrapper,
|
|
||||||
ReadOnlyPasswordHashField,
|
|
||||||
ReadOnlyPasswordHashWidget,
|
|
||||||
BooleanField,
|
|
||||||
CharField,
|
|
||||||
ChoiceField,
|
|
||||||
SplitDateTimeField,
|
|
||||||
CheckboxInput,
|
|
||||||
EmailInput,
|
|
||||||
Select,
|
|
||||||
TextInput,
|
|
||||||
]
|
|
||||||
],
|
|
||||||
List[
|
|
||||||
Union[
|
|
||||||
List[Tuple[str, str]],
|
|
||||||
RelatedFieldWidgetWrapper,
|
|
||||||
CharField,
|
|
||||||
ModelChoiceField,
|
|
||||||
MultiWidget,
|
|
||||||
Select,
|
|
||||||
TextInput,
|
|
||||||
]
|
|
||||||
],
|
|
||||||
List[Union[Tuple[int, str], Tuple[str, str]]],
|
|
||||||
List[
|
|
||||||
Union[
|
|
||||||
AdminTextareaWidget,
|
|
||||||
AdminURLFieldWidget,
|
|
||||||
CharField,
|
|
||||||
DateField,
|
|
||||||
IntegerField,
|
|
||||||
TimeField,
|
|
||||||
ModelChoiceField,
|
|
||||||
NumberInput,
|
|
||||||
TextInput,
|
|
||||||
]
|
|
||||||
],
|
|
||||||
List[
|
|
||||||
Union[
|
|
||||||
RelatedFieldWidgetWrapper,
|
|
||||||
CharField,
|
|
||||||
DateField,
|
|
||||||
SplitDateTimeField,
|
|
||||||
ModelChoiceField,
|
|
||||||
PasswordInput,
|
|
||||||
Select,
|
|
||||||
SplitDateTimeWidget,
|
|
||||||
TextInput,
|
|
||||||
Textarea,
|
|
||||||
]
|
|
||||||
],
|
|
||||||
List[
|
|
||||||
Union[
|
|
||||||
ReadOnlyPasswordHashField,
|
|
||||||
ReadOnlyPasswordHashWidget,
|
|
||||||
BooleanField,
|
|
||||||
CharField,
|
|
||||||
DateTimeField,
|
|
||||||
ModelChoiceField,
|
|
||||||
CheckboxInput,
|
|
||||||
EmailInput,
|
|
||||||
Select,
|
|
||||||
TextInput,
|
|
||||||
]
|
|
||||||
],
|
|
||||||
List[
|
|
||||||
Union[
|
|
||||||
CharField,
|
|
||||||
DateField,
|
|
||||||
TimeField,
|
|
||||||
ModelChoiceField,
|
|
||||||
EmailInput,
|
|
||||||
MultiWidget,
|
|
||||||
TextInput,
|
|
||||||
Textarea,
|
|
||||||
]
|
|
||||||
],
|
|
||||||
List[Union[NullBooleanField, HiddenInput]],
|
|
||||||
List[Union[ModelChoiceField, RadioSelect]],
|
|
||||||
OrderedDict,
|
|
||||||
Field,
|
|
||||||
Widget,
|
|
||||||
],
|
|
||||||
],
|
|
||||||
Dict[
|
|
||||||
int,
|
|
||||||
Union[
|
|
||||||
List[
|
|
||||||
Union[
|
|
||||||
List[Union[Tuple[int, str], Tuple[str, str]]],
|
|
||||||
AdminIntegerFieldWidget,
|
|
||||||
AdminTextInputWidget,
|
|
||||||
CharField,
|
|
||||||
IntegerField,
|
|
||||||
TypedChoiceField,
|
|
||||||
Select,
|
|
||||||
]
|
|
||||||
],
|
|
||||||
List[
|
|
||||||
Union[
|
|
||||||
List[Union[Tuple[int, str], Tuple[str, str]]],
|
|
||||||
RelatedFieldWidgetWrapper,
|
|
||||||
TypedChoiceField,
|
|
||||||
ModelChoiceField,
|
|
||||||
Select,
|
|
||||||
]
|
|
||||||
],
|
|
||||||
List[Union[Tuple[int, str], Tuple[str, str]]],
|
|
||||||
List[
|
|
||||||
Union[
|
|
||||||
CharField, FileField, ClearableFileInput, TextInput
|
|
||||||
]
|
|
||||||
],
|
|
||||||
List[
|
|
||||||
Union[
|
|
||||||
DateField,
|
|
||||||
DateTimeField,
|
|
||||||
IntegerField,
|
|
||||||
TimeField,
|
|
||||||
HiddenInput,
|
|
||||||
TextInput,
|
|
||||||
]
|
|
||||||
],
|
|
||||||
OrderedDict,
|
|
||||||
Field,
|
|
||||||
Widget,
|
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
@@ -410,8 +91,7 @@ class CharField(Field):
|
|||||||
show_hidden_initial: bool
|
show_hidden_initial: bool
|
||||||
validators: List[
|
validators: List[
|
||||||
Union[
|
Union[
|
||||||
django.core.validators.MaxLengthValidator,
|
django.core.validators.BaseValidator,
|
||||||
django.core.validators.MinLengthValidator,
|
|
||||||
django.core.validators.ProhibitNullCharactersValidator,
|
django.core.validators.ProhibitNullCharactersValidator,
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
@@ -446,12 +126,7 @@ class IntegerField(Field):
|
|||||||
min_value: Optional[int]
|
min_value: Optional[int]
|
||||||
required: bool
|
required: bool
|
||||||
show_hidden_initial: bool
|
show_hidden_initial: bool
|
||||||
validators: List[
|
validators: List[django.core.validators.BaseValidator]
|
||||||
Union[
|
|
||||||
django.core.validators.MaxValueValidator,
|
|
||||||
django.core.validators.MinValueValidator,
|
|
||||||
]
|
|
||||||
]
|
|
||||||
widget: django.forms.widgets.NumberInput = ...
|
widget: django.forms.widgets.NumberInput = ...
|
||||||
default_error_messages: Any = ...
|
default_error_messages: Any = ...
|
||||||
re_decimal: Any = ...
|
re_decimal: Any = ...
|
||||||
@@ -463,7 +138,7 @@ class IntegerField(Field):
|
|||||||
**kwargs: Any
|
**kwargs: Any
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
def to_python(
|
def to_python(
|
||||||
self, value: Optional[Union[float, int, str]]
|
self, value: Optional[Union[float, str]]
|
||||||
) -> Optional[int]: ...
|
) -> Optional[int]: ...
|
||||||
def widget_attrs(
|
def widget_attrs(
|
||||||
self, widget: Widget
|
self, widget: Widget
|
||||||
@@ -477,20 +152,15 @@ class FloatField(IntegerField):
|
|||||||
label: Optional[str]
|
label: Optional[str]
|
||||||
label_suffix: None
|
label_suffix: None
|
||||||
localize: bool
|
localize: bool
|
||||||
max_value: Optional[Union[float, int]]
|
max_value: Optional[float]
|
||||||
min_value: Optional[Union[float, int]]
|
min_value: Optional[float]
|
||||||
required: bool
|
required: bool
|
||||||
show_hidden_initial: bool
|
show_hidden_initial: bool
|
||||||
validators: List[
|
validators: List[django.core.validators.BaseValidator]
|
||||||
Union[
|
|
||||||
django.core.validators.MaxValueValidator,
|
|
||||||
django.core.validators.MinValueValidator,
|
|
||||||
]
|
|
||||||
]
|
|
||||||
widget: django.forms.widgets.NumberInput
|
widget: django.forms.widgets.NumberInput
|
||||||
default_error_messages: Any = ...
|
default_error_messages: Any = ...
|
||||||
def to_python(
|
def to_python(
|
||||||
self, value: Optional[Union[float, int, str]]
|
self, value: Optional[Union[float, str]]
|
||||||
) -> Optional[float]: ...
|
) -> Optional[float]: ...
|
||||||
def validate(self, value: Optional[float]) -> None: ...
|
def validate(self, value: Optional[float]) -> None: ...
|
||||||
def widget_attrs(
|
def widget_attrs(
|
||||||
@@ -513,9 +183,8 @@ class DecimalField(IntegerField):
|
|||||||
show_hidden_initial: bool
|
show_hidden_initial: bool
|
||||||
validators: List[
|
validators: List[
|
||||||
Union[
|
Union[
|
||||||
|
django.core.validators.BaseValidator,
|
||||||
django.core.validators.DecimalValidator,
|
django.core.validators.DecimalValidator,
|
||||||
django.core.validators.MaxValueValidator,
|
|
||||||
django.core.validators.MinValueValidator,
|
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
widget: django.forms.widgets.NumberInput
|
widget: django.forms.widgets.NumberInput
|
||||||
@@ -636,8 +305,7 @@ class RegexField(CharField):
|
|||||||
strip: bool
|
strip: bool
|
||||||
validators: List[
|
validators: List[
|
||||||
Union[
|
Union[
|
||||||
django.core.validators.MaxLengthValidator,
|
django.core.validators.BaseValidator,
|
||||||
django.core.validators.MinLengthValidator,
|
|
||||||
django.core.validators.ProhibitNullCharactersValidator,
|
django.core.validators.ProhibitNullCharactersValidator,
|
||||||
django.core.validators.RegexValidator,
|
django.core.validators.RegexValidator,
|
||||||
]
|
]
|
||||||
@@ -662,9 +330,8 @@ class EmailField(CharField):
|
|||||||
strip: bool
|
strip: bool
|
||||||
validators: List[
|
validators: List[
|
||||||
Union[
|
Union[
|
||||||
|
django.core.validators.BaseValidator,
|
||||||
django.core.validators.EmailValidator,
|
django.core.validators.EmailValidator,
|
||||||
django.core.validators.MaxLengthValidator,
|
|
||||||
django.core.validators.MinLengthValidator,
|
|
||||||
django.core.validators.ProhibitNullCharactersValidator,
|
django.core.validators.ProhibitNullCharactersValidator,
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
@@ -809,66 +476,14 @@ class ChoiceField(Field):
|
|||||||
def __init__(self, *, choices: Any = ..., **kwargs: Any) -> None: ...
|
def __init__(self, *, choices: Any = ..., **kwargs: Any) -> None: ...
|
||||||
def __deepcopy__(
|
def __deepcopy__(
|
||||||
self,
|
self,
|
||||||
memo: Union[
|
memo: Dict[
|
||||||
Dict[
|
int,
|
||||||
int,
|
Union[
|
||||||
Union[
|
List[Tuple[str, str]],
|
||||||
List[
|
List[Union[List[Tuple[str, str]], Field, Widget]],
|
||||||
Union[
|
OrderedDict,
|
||||||
List[Tuple[str, str]],
|
Field,
|
||||||
CharField,
|
Widget,
|
||||||
ChoiceField,
|
|
||||||
IntegerField,
|
|
||||||
EmailInput,
|
|
||||||
NumberInput,
|
|
||||||
Select,
|
|
||||||
TextInput,
|
|
||||||
]
|
|
||||||
],
|
|
||||||
List[
|
|
||||||
Union[
|
|
||||||
List[Tuple[str, str]],
|
|
||||||
CharField,
|
|
||||||
DateField,
|
|
||||||
TypedChoiceField,
|
|
||||||
Select,
|
|
||||||
TextInput,
|
|
||||||
]
|
|
||||||
],
|
|
||||||
List[
|
|
||||||
Union[
|
|
||||||
List[Union[Tuple[int, str], Tuple[str, str]]],
|
|
||||||
RelatedFieldWidgetWrapper,
|
|
||||||
TypedChoiceField,
|
|
||||||
ModelChoiceField,
|
|
||||||
Select,
|
|
||||||
]
|
|
||||||
],
|
|
||||||
List[Union[Tuple[int, str], Tuple[str, str]]],
|
|
||||||
List[
|
|
||||||
Union[
|
|
||||||
CharField,
|
|
||||||
DateField,
|
|
||||||
ModelChoiceField,
|
|
||||||
Select,
|
|
||||||
TextInput,
|
|
||||||
Textarea,
|
|
||||||
]
|
|
||||||
],
|
|
||||||
OrderedDict,
|
|
||||||
Field,
|
|
||||||
Widget,
|
|
||||||
],
|
|
||||||
],
|
|
||||||
Dict[
|
|
||||||
int,
|
|
||||||
Union[
|
|
||||||
List[Union[CharField, PasswordInput, TextInput]],
|
|
||||||
List[Union[MultiWidget, TextInput]],
|
|
||||||
OrderedDict,
|
|
||||||
Field,
|
|
||||||
Widget,
|
|
||||||
],
|
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
) -> ChoiceField: ...
|
) -> ChoiceField: ...
|
||||||
@@ -892,7 +507,7 @@ class TypedChoiceField(ChoiceField):
|
|||||||
) -> None: ...
|
) -> None: ...
|
||||||
def clean(
|
def clean(
|
||||||
self, value: Optional[str]
|
self, value: Optional[str]
|
||||||
) -> Optional[Union[Decimal, float, int, str]]: ...
|
) -> Optional[Union[Decimal, float, str]]: ...
|
||||||
|
|
||||||
class MultipleChoiceField(ChoiceField):
|
class MultipleChoiceField(ChoiceField):
|
||||||
disabled: bool
|
disabled: bool
|
||||||
@@ -969,33 +584,20 @@ class MultiValueField(Field):
|
|||||||
) -> None: ...
|
) -> None: ...
|
||||||
def __deepcopy__(
|
def __deepcopy__(
|
||||||
self,
|
self,
|
||||||
memo: Dict[
|
memo: Union[
|
||||||
int,
|
Dict[
|
||||||
Union[
|
int,
|
||||||
List[Tuple[str, str]],
|
Union[
|
||||||
List[
|
List[Tuple[str, str]],
|
||||||
Union[
|
List[Union[List[Tuple[str, str]], Widget]],
|
||||||
List[Tuple[str, str]],
|
OrderedDict,
|
||||||
AdminEmailInputWidget,
|
Field,
|
||||||
RelatedFieldWidgetWrapper,
|
Widget,
|
||||||
ReadOnlyPasswordHashField,
|
|
||||||
ReadOnlyPasswordHashWidget,
|
|
||||||
BooleanField,
|
|
||||||
CharField,
|
|
||||||
SplitDateTimeField,
|
|
||||||
ModelChoiceField,
|
|
||||||
CheckboxInput,
|
|
||||||
MultiWidget,
|
|
||||||
Select,
|
|
||||||
TextInput,
|
|
||||||
]
|
|
||||||
],
|
],
|
||||||
List[
|
],
|
||||||
Union[AdminTextInputWidget, AdminTextareaWidget, CharField]
|
Dict[
|
||||||
],
|
int,
|
||||||
OrderedDict,
|
Union[List[Union[Field, Widget]], OrderedDict, Field, Widget],
|
||||||
Field,
|
|
||||||
Widget,
|
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
) -> MultiValueField: ...
|
) -> MultiValueField: ...
|
||||||
|
|||||||
@@ -57,8 +57,8 @@ class BaseForm:
|
|||||||
prefix: Optional[str] = ...,
|
prefix: Optional[str] = ...,
|
||||||
initial: Optional[
|
initial: Optional[
|
||||||
Union[
|
Union[
|
||||||
|
Dict[str, List[int]],
|
||||||
Dict[str, Optional[Union[List[Model], date, int, str]]],
|
Dict[str, Optional[Union[List[Model], date, int, str]]],
|
||||||
Dict[str, Optional[Union[List[int], date, int, str]]],
|
|
||||||
Dict[str, Union[List[Model], Model, QuerySet]],
|
Dict[str, Union[List[Model], Model, QuerySet]],
|
||||||
Dict[str, Union[List[str], str]],
|
Dict[str, Union[List[str], str]],
|
||||||
Dict[str, Union[FieldFile, int, str]],
|
Dict[str, Union[FieldFile, int, str]],
|
||||||
@@ -93,7 +93,7 @@ class BaseForm:
|
|||||||
self
|
self
|
||||||
) -> Union[
|
) -> Union[
|
||||||
Dict[str, Optional[Union[int, str]]],
|
Dict[str, Optional[Union[int, str]]],
|
||||||
Dict[str, Union[date, time, Decimal, float, int]],
|
Dict[str, Union[date, time, Decimal, float]],
|
||||||
Dict[str, Union[date, str]],
|
Dict[str, Union[date, str]],
|
||||||
Dict[str, SimpleUploadedFile],
|
Dict[str, SimpleUploadedFile],
|
||||||
Dict[str, QuerySet],
|
Dict[str, QuerySet],
|
||||||
@@ -105,20 +105,6 @@ class BaseForm:
|
|||||||
def is_multipart(self): ...
|
def is_multipart(self): ...
|
||||||
def hidden_fields(self): ...
|
def hidden_fields(self): ...
|
||||||
def visible_fields(self): ...
|
def visible_fields(self): ...
|
||||||
def get_initial_for_field(
|
def get_initial_for_field(self, field: Field, field_name: str) -> Any: ...
|
||||||
self, field: Field, field_name: str
|
|
||||||
) -> Optional[
|
|
||||||
Union[
|
|
||||||
List[Model],
|
|
||||||
List[int],
|
|
||||||
List[str],
|
|
||||||
date,
|
|
||||||
Model,
|
|
||||||
FieldFile,
|
|
||||||
QuerySet,
|
|
||||||
int,
|
|
||||||
str,
|
|
||||||
]
|
|
||||||
]: ...
|
|
||||||
|
|
||||||
class Form(BaseForm): ...
|
class Form(BaseForm): ...
|
||||||
|
|||||||
@@ -6,15 +6,7 @@ from typing import (Any, Callable, Dict, Iterator, List, Optional, Tuple, Type,
|
|||||||
from unittest.mock import MagicMock
|
from unittest.mock import MagicMock
|
||||||
from uuid import UUID
|
from uuid import UUID
|
||||||
|
|
||||||
from django.contrib.admin.widgets import (AdminEmailInputWidget,
|
from django.contrib.auth.forms import UserChangeForm, UserCreationForm
|
||||||
AdminFileWidget, AdminSplitDateTime,
|
|
||||||
AdminTextInputWidget,
|
|
||||||
AdminURLFieldWidget,
|
|
||||||
FilteredSelectMultiple,
|
|
||||||
RelatedFieldWidgetWrapper)
|
|
||||||
from django.contrib.auth.forms import (ReadOnlyPasswordHashField,
|
|
||||||
ReadOnlyPasswordHashWidget,
|
|
||||||
UserChangeForm, UserCreationForm)
|
|
||||||
from django.contrib.flatpages.forms import FlatpageForm
|
from django.contrib.flatpages.forms import FlatpageForm
|
||||||
from django.core.files.base import File
|
from django.core.files.base import File
|
||||||
from django.core.files.uploadedfile import SimpleUploadedFile
|
from django.core.files.uploadedfile import SimpleUploadedFile
|
||||||
@@ -23,15 +15,11 @@ from django.db.models.fields.files import FieldFile
|
|||||||
from django.db.models.manager import Manager
|
from django.db.models.manager import Manager
|
||||||
from django.db.models.query import QuerySet
|
from django.db.models.query import QuerySet
|
||||||
from django.db.models.query_utils import Q
|
from django.db.models.query_utils import Q
|
||||||
from django.forms.fields import (BooleanField, CharField, ChoiceField,
|
from django.forms.fields import CharField, ChoiceField, Field
|
||||||
DateField, DateTimeField, Field, FileField,
|
|
||||||
IntegerField, SplitDateTimeField, URLField)
|
|
||||||
from django.forms.forms import BaseForm, DeclarativeFieldsMetaclass
|
from django.forms.forms import BaseForm, DeclarativeFieldsMetaclass
|
||||||
from django.forms.formsets import BaseFormSet
|
from django.forms.formsets import BaseFormSet
|
||||||
from django.forms.utils import ErrorList
|
from django.forms.utils import ErrorList
|
||||||
from django.forms.widgets import (CheckboxInput, DateTimeInput, NumberInput,
|
from django.forms.widgets import Widget
|
||||||
RadioSelect, Select, SelectMultiple,
|
|
||||||
Textarea, TextInput, Widget)
|
|
||||||
|
|
||||||
ALL_FIELDS: str
|
ALL_FIELDS: str
|
||||||
|
|
||||||
@@ -84,7 +72,6 @@ class ModelFormOptions:
|
|||||||
options: Optional[
|
options: Optional[
|
||||||
Type[
|
Type[
|
||||||
Union[
|
Union[
|
||||||
Any,
|
|
||||||
UserChangeForm.Meta,
|
UserChangeForm.Meta,
|
||||||
UserCreationForm.Meta,
|
UserCreationForm.Meta,
|
||||||
FlatpageForm.Meta,
|
FlatpageForm.Meta,
|
||||||
@@ -136,7 +123,7 @@ class BaseModelForm(BaseForm):
|
|||||||
Dict[str, Optional[Union[bool, datetime, QuerySet, str]]],
|
Dict[str, Optional[Union[bool, datetime, QuerySet, str]]],
|
||||||
Dict[str, Optional[Union[date, Model, QuerySet, str]]],
|
Dict[str, Optional[Union[date, Model, QuerySet, str]]],
|
||||||
Dict[str, Optional[Union[Model, int, str]]],
|
Dict[str, Optional[Union[Model, int, str]]],
|
||||||
Dict[str, Union[date, Decimal, int, str]],
|
Dict[str, Union[datetime, Decimal, int, str]],
|
||||||
Dict[str, Union[File, str]],
|
Dict[str, Union[File, str]],
|
||||||
]: ...
|
]: ...
|
||||||
def validate_unique(self) -> None: ...
|
def validate_unique(self) -> None: ...
|
||||||
@@ -339,96 +326,13 @@ class ModelChoiceField(ChoiceField):
|
|||||||
]: ...
|
]: ...
|
||||||
def __deepcopy__(
|
def __deepcopy__(
|
||||||
self,
|
self,
|
||||||
memo: Union[
|
memo: Dict[
|
||||||
Dict[
|
int, Union[List[Union[Field, Widget]], OrderedDict, Field, Widget]
|
||||||
int,
|
|
||||||
Union[
|
|
||||||
List[
|
|
||||||
Union[
|
|
||||||
AdminEmailInputWidget,
|
|
||||||
AdminTextInputWidget,
|
|
||||||
FilteredSelectMultiple,
|
|
||||||
RelatedFieldWidgetWrapper,
|
|
||||||
ReadOnlyPasswordHashField,
|
|
||||||
ReadOnlyPasswordHashWidget,
|
|
||||||
BooleanField,
|
|
||||||
CharField,
|
|
||||||
ModelMultipleChoiceField,
|
|
||||||
CheckboxInput,
|
|
||||||
]
|
|
||||||
],
|
|
||||||
List[
|
|
||||||
Union[
|
|
||||||
AdminSplitDateTime,
|
|
||||||
RelatedFieldWidgetWrapper,
|
|
||||||
CharField,
|
|
||||||
DateField,
|
|
||||||
SplitDateTimeField,
|
|
||||||
ModelChoiceField,
|
|
||||||
Select,
|
|
||||||
TextInput,
|
|
||||||
Textarea,
|
|
||||||
]
|
|
||||||
],
|
|
||||||
List[
|
|
||||||
Union[
|
|
||||||
AdminSplitDateTime,
|
|
||||||
BooleanField,
|
|
||||||
CharField,
|
|
||||||
SplitDateTimeField,
|
|
||||||
CheckboxInput,
|
|
||||||
TextInput,
|
|
||||||
Textarea,
|
|
||||||
]
|
|
||||||
],
|
|
||||||
List[Union[AdminURLFieldWidget, URLField]],
|
|
||||||
List[
|
|
||||||
Union[
|
|
||||||
ReadOnlyPasswordHashField,
|
|
||||||
ReadOnlyPasswordHashWidget,
|
|
||||||
BooleanField,
|
|
||||||
DateTimeField,
|
|
||||||
ModelMultipleChoiceField,
|
|
||||||
CheckboxInput,
|
|
||||||
DateTimeInput,
|
|
||||||
SelectMultiple,
|
|
||||||
]
|
|
||||||
],
|
|
||||||
List[Union[IntegerField, NumberInput]],
|
|
||||||
List[Union[ModelChoiceField, RadioSelect]],
|
|
||||||
OrderedDict,
|
|
||||||
Field,
|
|
||||||
Widget,
|
|
||||||
],
|
|
||||||
],
|
|
||||||
Dict[
|
|
||||||
int,
|
|
||||||
Union[
|
|
||||||
List[
|
|
||||||
Union[
|
|
||||||
AdminFileWidget,
|
|
||||||
AdminTextInputWidget,
|
|
||||||
CharField,
|
|
||||||
FileField,
|
|
||||||
]
|
|
||||||
],
|
|
||||||
OrderedDict,
|
|
||||||
AdminFileWidget,
|
|
||||||
AdminTextInputWidget,
|
|
||||||
CharField,
|
|
||||||
FileField,
|
|
||||||
],
|
|
||||||
],
|
|
||||||
],
|
],
|
||||||
) -> ModelChoiceField: ...
|
) -> ModelChoiceField: ...
|
||||||
def label_from_instance(self, obj: Model) -> str: ...
|
def label_from_instance(self, obj: Model) -> str: ...
|
||||||
choices: Any = ...
|
choices: Any = ...
|
||||||
def prepare_value(
|
def prepare_value(self, value: Any) -> Any: ...
|
||||||
self,
|
|
||||||
value: Optional[
|
|
||||||
Union[Dict[str, str], List[str], Model, int, str, UUID]
|
|
||||||
],
|
|
||||||
) -> Optional[Union[Dict[str, str], List[str], int, str, UUID]]: ...
|
|
||||||
def to_python(
|
def to_python(
|
||||||
self,
|
self,
|
||||||
value: Optional[Union[List[Dict[str, str]], List[List[str]], int, str]],
|
value: Optional[Union[List[Dict[str, str]], List[List[str]], int, str]],
|
||||||
@@ -526,19 +430,7 @@ class ModelMultipleChoiceField(ModelChoiceField):
|
|||||||
],
|
],
|
||||||
) -> QuerySet: ...
|
) -> QuerySet: ...
|
||||||
def prepare_value(
|
def prepare_value(
|
||||||
self,
|
self, value: Any
|
||||||
value: Optional[
|
|
||||||
Union[
|
|
||||||
List[Dict[str, str]],
|
|
||||||
List[List[str]],
|
|
||||||
List[Union[int, str]],
|
|
||||||
List[Model],
|
|
||||||
Tuple,
|
|
||||||
Model,
|
|
||||||
QuerySet,
|
|
||||||
str,
|
|
||||||
]
|
|
||||||
],
|
|
||||||
) -> Optional[
|
) -> Optional[
|
||||||
Union[
|
Union[
|
||||||
List[Dict[str, str]],
|
List[Dict[str, str]],
|
||||||
|
|||||||
+244
-577
@@ -22,34 +22,7 @@ class BaseRenderer:
|
|||||||
str,
|
str,
|
||||||
Optional[
|
Optional[
|
||||||
Union[
|
Union[
|
||||||
Dict[str, Union[bool, Decimal, str]],
|
Dict[str, Union[bool, float, str]],
|
||||||
List[
|
|
||||||
Tuple[
|
|
||||||
None,
|
|
||||||
List[
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
Dict[Any, Any], bool, time, str
|
|
||||||
],
|
|
||||||
]
|
|
||||||
],
|
|
||||||
int,
|
|
||||||
]
|
|
||||||
],
|
|
||||||
bool,
|
|
||||||
str,
|
|
||||||
]
|
|
||||||
],
|
|
||||||
],
|
|
||||||
],
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Optional[
|
|
||||||
Union[
|
|
||||||
Dict[str, Union[bool, str]],
|
|
||||||
List[
|
List[
|
||||||
Union[
|
Union[
|
||||||
Dict[
|
Dict[
|
||||||
@@ -80,21 +53,10 @@ class BaseRenderer:
|
|||||||
]
|
]
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Optional[
|
|
||||||
Union[
|
|
||||||
Dict[str, Union[bool, str]],
|
|
||||||
bool,
|
|
||||||
str,
|
|
||||||
]
|
|
||||||
],
|
|
||||||
],
|
|
||||||
Dict[
|
Dict[
|
||||||
str,
|
str,
|
||||||
Union[
|
Union[
|
||||||
Dict[str, Union[bool, str]],
|
Dict[str, Union[bool, str]],
|
||||||
List[Any],
|
|
||||||
List[
|
List[
|
||||||
Tuple[
|
Tuple[
|
||||||
None,
|
None,
|
||||||
@@ -129,73 +91,19 @@ class BaseRenderer:
|
|||||||
str,
|
str,
|
||||||
Optional[
|
Optional[
|
||||||
Union[
|
Union[
|
||||||
Dict[str, Union[float, int, str]],
|
Dict[str, Union[Decimal, int, str]],
|
||||||
List[
|
List[
|
||||||
Dict[
|
Dict[
|
||||||
str,
|
str,
|
||||||
Optional[Union[Dict[str, str], bool, str]],
|
Optional[Union[Dict[str, str], bool, str]],
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
bool,
|
int,
|
||||||
str,
|
str,
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
Dict[Any, Any],
|
|
||||||
List[
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
Dict[Any, Any],
|
|
||||||
List[
|
|
||||||
Union[
|
|
||||||
Tuple[
|
|
||||||
None,
|
|
||||||
List[
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
Dict[Any, Any],
|
|
||||||
bool,
|
|
||||||
str,
|
|
||||||
],
|
|
||||||
]
|
|
||||||
],
|
|
||||||
int,
|
|
||||||
],
|
|
||||||
Tuple[
|
|
||||||
None,
|
|
||||||
List[
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
Dict[str, bool],
|
|
||||||
bool,
|
|
||||||
str,
|
|
||||||
],
|
|
||||||
]
|
|
||||||
],
|
|
||||||
int,
|
|
||||||
],
|
|
||||||
]
|
|
||||||
],
|
|
||||||
List[str],
|
|
||||||
bool,
|
|
||||||
str,
|
|
||||||
],
|
|
||||||
]
|
|
||||||
],
|
|
||||||
bool,
|
|
||||||
str,
|
|
||||||
],
|
|
||||||
],
|
|
||||||
],
|
|
||||||
Dict[
|
Dict[
|
||||||
str,
|
str,
|
||||||
Dict[
|
Dict[
|
||||||
@@ -204,14 +112,11 @@ class BaseRenderer:
|
|||||||
Dict[Any, Any],
|
Dict[Any, Any],
|
||||||
List[
|
List[
|
||||||
Tuple[
|
Tuple[
|
||||||
None,
|
|
||||||
List[
|
List[
|
||||||
Dict[
|
Dict[str, Union[Dict[Any, Any], bool, str]]
|
||||||
str,
|
|
||||||
Union[Dict[Any, Any], bool, time, str],
|
|
||||||
]
|
|
||||||
],
|
],
|
||||||
int,
|
int,
|
||||||
|
int,
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
List[str],
|
List[str],
|
||||||
@@ -244,41 +149,24 @@ class BaseRenderer:
|
|||||||
str,
|
str,
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
Dict[str, Union[Dict[Any, Any], bool, str]],
|
|
||||||
Dict[
|
Dict[
|
||||||
str,
|
str,
|
||||||
Union[
|
Union[
|
||||||
Dict[str, bool],
|
Dict[str, bool],
|
||||||
List[
|
List[
|
||||||
Union[
|
Tuple[
|
||||||
Tuple[
|
None,
|
||||||
None,
|
List[
|
||||||
List[
|
Dict[
|
||||||
Dict[
|
str,
|
||||||
|
Union[
|
||||||
|
Dict[str, bool],
|
||||||
|
bool,
|
||||||
str,
|
str,
|
||||||
Union[
|
],
|
||||||
Dict[Any, Any],
|
]
|
||||||
bool,
|
|
||||||
str,
|
|
||||||
],
|
|
||||||
]
|
|
||||||
],
|
|
||||||
int,
|
|
||||||
],
|
|
||||||
Tuple[
|
|
||||||
None,
|
|
||||||
List[
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
Dict[str, bool],
|
|
||||||
bool,
|
|
||||||
str,
|
|
||||||
],
|
|
||||||
]
|
|
||||||
],
|
|
||||||
int,
|
|
||||||
],
|
],
|
||||||
|
int,
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
List[str],
|
List[str],
|
||||||
@@ -288,6 +176,41 @@ class BaseRenderer:
|
|||||||
],
|
],
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
|
bool,
|
||||||
|
str,
|
||||||
|
],
|
||||||
|
],
|
||||||
|
],
|
||||||
|
Dict[
|
||||||
|
str,
|
||||||
|
Dict[
|
||||||
|
str,
|
||||||
|
Union[
|
||||||
|
Dict[Any, Any],
|
||||||
|
List[
|
||||||
|
Union[
|
||||||
|
Tuple[
|
||||||
|
None,
|
||||||
|
List[
|
||||||
|
Dict[
|
||||||
|
str,
|
||||||
|
Union[Dict[Any, Any], bool, str],
|
||||||
|
]
|
||||||
|
],
|
||||||
|
int,
|
||||||
|
],
|
||||||
|
Tuple[
|
||||||
|
str,
|
||||||
|
List[
|
||||||
|
Dict[
|
||||||
|
str,
|
||||||
|
Union[Dict[str, bool], bool, str],
|
||||||
|
]
|
||||||
|
],
|
||||||
|
int,
|
||||||
|
],
|
||||||
|
]
|
||||||
|
],
|
||||||
List[str],
|
List[str],
|
||||||
bool,
|
bool,
|
||||||
str,
|
str,
|
||||||
@@ -304,108 +227,12 @@ class BaseRenderer:
|
|||||||
Tuple[
|
Tuple[
|
||||||
None,
|
None,
|
||||||
List[
|
List[
|
||||||
Dict[str, Union[Dict[str, str], int, str]]
|
Dict[
|
||||||
],
|
|
||||||
int,
|
|
||||||
]
|
|
||||||
],
|
|
||||||
List[
|
|
||||||
Union[
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
Dict[str, Union[bool, str]],
|
|
||||||
List[
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
Dict[str, Union[bool, str]],
|
|
||||||
bool,
|
|
||||||
str,
|
|
||||||
],
|
|
||||||
]
|
|
||||||
],
|
|
||||||
bool,
|
|
||||||
str,
|
str,
|
||||||
],
|
Union[
|
||||||
],
|
Dict[str, Union[bool, str]],
|
||||||
Dict[
|
int,
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
Dict[str, Union[bool, str]],
|
|
||||||
List[
|
|
||||||
Union[
|
|
||||||
Tuple[
|
|
||||||
None,
|
|
||||||
List[
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
Dict[Any, Any],
|
|
||||||
bool,
|
|
||||||
str,
|
|
||||||
],
|
|
||||||
]
|
|
||||||
],
|
|
||||||
int,
|
|
||||||
],
|
|
||||||
Tuple[
|
|
||||||
None,
|
|
||||||
List[
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
Dict[str, bool],
|
|
||||||
bool,
|
|
||||||
str,
|
|
||||||
],
|
|
||||||
]
|
|
||||||
],
|
|
||||||
int,
|
|
||||||
],
|
|
||||||
]
|
|
||||||
],
|
|
||||||
List[str],
|
|
||||||
bool,
|
|
||||||
str,
|
|
||||||
],
|
|
||||||
],
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
Dict[str, Union[bool, str]], bool, str
|
|
||||||
],
|
|
||||||
],
|
|
||||||
]
|
|
||||||
],
|
|
||||||
bool,
|
|
||||||
str,
|
|
||||||
],
|
|
||||||
],
|
|
||||||
],
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
Dict[str, Union[bool, str]],
|
|
||||||
List[
|
|
||||||
Tuple[
|
|
||||||
None,
|
|
||||||
List[
|
|
||||||
Union[
|
|
||||||
Dict[
|
|
||||||
str,
|
str,
|
||||||
Union[Dict[Any, Any], bool, str],
|
|
||||||
],
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
Dict[str, bool],
|
|
||||||
Set[str],
|
|
||||||
int,
|
|
||||||
str,
|
|
||||||
],
|
|
||||||
],
|
],
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
@@ -426,184 +253,11 @@ class BaseRenderer:
|
|||||||
Dict[str, Union[bool, str]],
|
Dict[str, Union[bool, str]],
|
||||||
List[
|
List[
|
||||||
Union[
|
Union[
|
||||||
Tuple[
|
Dict[
|
||||||
None,
|
|
||||||
List[
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[Dict[Any, Any], bool, str],
|
|
||||||
]
|
|
||||||
],
|
|
||||||
int,
|
|
||||||
],
|
|
||||||
Tuple[
|
|
||||||
None,
|
|
||||||
List[
|
|
||||||
Dict[
|
|
||||||
str, Union[Dict[Any, Any], int, str]
|
|
||||||
]
|
|
||||||
],
|
|
||||||
int,
|
|
||||||
],
|
|
||||||
Tuple[
|
|
||||||
None,
|
|
||||||
List[
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[Dict[str, bool], int, str],
|
|
||||||
]
|
|
||||||
],
|
|
||||||
int,
|
|
||||||
],
|
|
||||||
]
|
|
||||||
],
|
|
||||||
List[str],
|
|
||||||
bool,
|
|
||||||
str,
|
|
||||||
],
|
|
||||||
],
|
|
||||||
],
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
Dict[str, Union[bool, str]],
|
|
||||||
List[
|
|
||||||
Union[
|
|
||||||
Tuple[
|
|
||||||
None,
|
|
||||||
List[
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
Dict[str, Union[bool, str]],
|
|
||||||
bool,
|
|
||||||
str,
|
|
||||||
],
|
|
||||||
]
|
|
||||||
],
|
|
||||||
int,
|
|
||||||
],
|
|
||||||
Tuple[
|
|
||||||
None,
|
|
||||||
List[
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
Dict[str, Union[bool, str]],
|
|
||||||
int,
|
|
||||||
str,
|
|
||||||
],
|
|
||||||
]
|
|
||||||
],
|
|
||||||
int,
|
|
||||||
],
|
|
||||||
]
|
|
||||||
],
|
|
||||||
List[str],
|
|
||||||
bool,
|
|
||||||
str,
|
|
||||||
],
|
|
||||||
],
|
|
||||||
],
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
Dict[str, Union[bool, str]],
|
|
||||||
List[
|
|
||||||
Union[
|
|
||||||
Tuple[
|
|
||||||
None,
|
|
||||||
List[
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
Dict[str, Union[bool, str]],
|
|
||||||
bool,
|
|
||||||
str,
|
|
||||||
],
|
|
||||||
]
|
|
||||||
],
|
|
||||||
int,
|
|
||||||
],
|
|
||||||
Tuple[
|
|
||||||
None,
|
|
||||||
List[
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[Dict[str, str], bool, str],
|
|
||||||
]
|
|
||||||
],
|
|
||||||
int,
|
|
||||||
],
|
|
||||||
]
|
|
||||||
],
|
|
||||||
List[str],
|
|
||||||
bool,
|
|
||||||
str,
|
|
||||||
],
|
|
||||||
],
|
|
||||||
],
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
Dict[str, Union[int, str]],
|
|
||||||
List[
|
|
||||||
Union[
|
|
||||||
Tuple[
|
|
||||||
None,
|
|
||||||
List[
|
|
||||||
Dict[
|
|
||||||
str, Union[Dict[Any, Any], int, str]
|
|
||||||
]
|
|
||||||
],
|
|
||||||
int,
|
|
||||||
],
|
|
||||||
Tuple[
|
|
||||||
None,
|
|
||||||
List[
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[Dict[str, bool], bool, str],
|
|
||||||
]
|
|
||||||
],
|
|
||||||
int,
|
|
||||||
],
|
|
||||||
]
|
|
||||||
],
|
|
||||||
List[str],
|
|
||||||
bool,
|
|
||||||
str,
|
|
||||||
],
|
|
||||||
],
|
|
||||||
],
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
Dict[str, Union[int, str]],
|
|
||||||
List[
|
|
||||||
Union[
|
|
||||||
Tuple[
|
|
||||||
None,
|
|
||||||
List[
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[Dict[str, str], bool, str],
|
|
||||||
]
|
|
||||||
],
|
|
||||||
int,
|
|
||||||
],
|
|
||||||
Tuple[
|
|
||||||
str,
|
str,
|
||||||
List[
|
Union[
|
||||||
Union[
|
Dict[str, Union[bool, str]],
|
||||||
|
List[
|
||||||
Dict[
|
Dict[
|
||||||
str,
|
str,
|
||||||
Union[
|
Union[
|
||||||
@@ -611,21 +265,40 @@ class BaseRenderer:
|
|||||||
bool,
|
bool,
|
||||||
str,
|
str,
|
||||||
],
|
],
|
||||||
],
|
]
|
||||||
Dict[
|
],
|
||||||
str,
|
bool,
|
||||||
Union[
|
str,
|
||||||
Dict[str, str], bool, str
|
],
|
||||||
],
|
],
|
||||||
],
|
Dict[
|
||||||
]
|
str,
|
||||||
|
Union[
|
||||||
|
Dict[str, Union[bool, str]],
|
||||||
|
List[
|
||||||
|
Tuple[
|
||||||
|
None,
|
||||||
|
List[
|
||||||
|
Dict[
|
||||||
|
str,
|
||||||
|
Union[
|
||||||
|
Dict[str, bool],
|
||||||
|
bool,
|
||||||
|
str,
|
||||||
|
],
|
||||||
|
]
|
||||||
|
],
|
||||||
|
int,
|
||||||
|
]
|
||||||
|
],
|
||||||
|
List[str],
|
||||||
|
bool,
|
||||||
|
str,
|
||||||
],
|
],
|
||||||
int,
|
|
||||||
],
|
],
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
List[str],
|
bool,
|
||||||
int,
|
|
||||||
str,
|
str,
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
@@ -635,7 +308,7 @@ class BaseRenderer:
|
|||||||
Dict[
|
Dict[
|
||||||
str,
|
str,
|
||||||
Union[
|
Union[
|
||||||
Dict[str, bool],
|
Dict[str, Union[bool, str]],
|
||||||
List[
|
List[
|
||||||
Union[
|
Union[
|
||||||
Tuple[
|
Tuple[
|
||||||
@@ -643,17 +316,17 @@ class BaseRenderer:
|
|||||||
List[
|
List[
|
||||||
Dict[
|
Dict[
|
||||||
str,
|
str,
|
||||||
Union[Dict[Any, Any], bool, str],
|
Union[Dict[str, bool], bool, str],
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
int,
|
int,
|
||||||
],
|
],
|
||||||
Tuple[
|
Tuple[
|
||||||
None,
|
str,
|
||||||
List[
|
List[
|
||||||
Dict[
|
Dict[
|
||||||
str,
|
str,
|
||||||
Union[Dict[str, bool], bool, str],
|
Union[Dict[Any, Any], bool, str],
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
int,
|
int,
|
||||||
@@ -666,6 +339,56 @@ class BaseRenderer:
|
|||||||
],
|
],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
|
Dict[
|
||||||
|
str,
|
||||||
|
Dict[
|
||||||
|
str,
|
||||||
|
Union[
|
||||||
|
Dict[str, Union[int, str]],
|
||||||
|
List[
|
||||||
|
Tuple[
|
||||||
|
None,
|
||||||
|
List[
|
||||||
|
Dict[
|
||||||
|
str,
|
||||||
|
Union[Dict[Any, Any], time, int, str],
|
||||||
|
]
|
||||||
|
],
|
||||||
|
int,
|
||||||
|
]
|
||||||
|
],
|
||||||
|
List[str],
|
||||||
|
bool,
|
||||||
|
str,
|
||||||
|
],
|
||||||
|
],
|
||||||
|
],
|
||||||
|
Dict[
|
||||||
|
str,
|
||||||
|
Dict[
|
||||||
|
str,
|
||||||
|
Union[
|
||||||
|
Dict[str, Union[int, str]],
|
||||||
|
List[
|
||||||
|
Tuple[
|
||||||
|
None,
|
||||||
|
List[
|
||||||
|
Dict[
|
||||||
|
str,
|
||||||
|
Union[
|
||||||
|
Dict[str, bool], Set[str], int, str
|
||||||
|
],
|
||||||
|
]
|
||||||
|
],
|
||||||
|
int,
|
||||||
|
]
|
||||||
|
],
|
||||||
|
List[str],
|
||||||
|
bool,
|
||||||
|
str,
|
||||||
|
],
|
||||||
|
],
|
||||||
|
],
|
||||||
Dict[
|
Dict[
|
||||||
str,
|
str,
|
||||||
Dict[
|
Dict[
|
||||||
@@ -673,37 +396,12 @@ class BaseRenderer:
|
|||||||
Union[
|
Union[
|
||||||
Dict[str, bool],
|
Dict[str, bool],
|
||||||
List[
|
List[
|
||||||
Union[
|
Tuple[
|
||||||
Tuple[
|
List[
|
||||||
None,
|
Dict[str, Union[Dict[str, bool], bool, str]]
|
||||||
List[
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[Dict[str, bool], bool, str],
|
|
||||||
]
|
|
||||||
],
|
|
||||||
int,
|
|
||||||
],
|
|
||||||
Tuple[
|
|
||||||
str,
|
|
||||||
List[
|
|
||||||
Union[
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
Dict[Any, Any], bool, str
|
|
||||||
],
|
|
||||||
],
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
Dict[str, bool], bool, str
|
|
||||||
],
|
|
||||||
],
|
|
||||||
]
|
|
||||||
],
|
|
||||||
int,
|
|
||||||
],
|
],
|
||||||
|
int,
|
||||||
|
int,
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
List[str],
|
List[str],
|
||||||
@@ -732,30 +430,14 @@ class BaseRenderer:
|
|||||||
Union[
|
Union[
|
||||||
Dict[str, str],
|
Dict[str, str],
|
||||||
List[
|
List[
|
||||||
Union[
|
Tuple[
|
||||||
Tuple[
|
None,
|
||||||
None,
|
List[
|
||||||
List[
|
Dict[str, Union[Dict[str, str], int, str]]
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[Dict[Any, Any], bool, str],
|
|
||||||
]
|
|
||||||
],
|
|
||||||
int,
|
|
||||||
],
|
|
||||||
Tuple[
|
|
||||||
None,
|
|
||||||
List[
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[Dict[str, bool], bool, str],
|
|
||||||
]
|
|
||||||
],
|
|
||||||
int,
|
|
||||||
],
|
],
|
||||||
|
int,
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
List[str],
|
|
||||||
bool,
|
bool,
|
||||||
str,
|
str,
|
||||||
],
|
],
|
||||||
@@ -784,28 +466,10 @@ class BaseRenderer:
|
|||||||
List[
|
List[
|
||||||
Dict[
|
Dict[
|
||||||
str,
|
str,
|
||||||
Union[Dict[str, str], bool, str],
|
Union[
|
||||||
]
|
Dict[str, Union[bool, str]],
|
||||||
],
|
bool,
|
||||||
int,
|
|
||||||
],
|
|
||||||
Tuple[
|
|
||||||
str,
|
|
||||||
List[
|
|
||||||
Union[
|
|
||||||
Dict[
|
|
||||||
str,
|
str,
|
||||||
Union[
|
|
||||||
Dict[str, Union[bool, str]],
|
|
||||||
bool,
|
|
||||||
str,
|
|
||||||
],
|
|
||||||
],
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
Dict[str, str], bool, str
|
|
||||||
],
|
|
||||||
],
|
],
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
@@ -909,7 +573,34 @@ class BaseRenderer:
|
|||||||
str,
|
str,
|
||||||
Union[
|
Union[
|
||||||
Dict[Any, Any],
|
Dict[Any, Any],
|
||||||
List[Dict[str, Union[Dict[str, str], bool, str]]],
|
List[
|
||||||
|
Dict[
|
||||||
|
str,
|
||||||
|
Union[
|
||||||
|
Dict[Any, Any],
|
||||||
|
List[
|
||||||
|
Tuple[
|
||||||
|
None,
|
||||||
|
List[
|
||||||
|
Dict[
|
||||||
|
str,
|
||||||
|
Union[
|
||||||
|
Dict[str, bool],
|
||||||
|
bool,
|
||||||
|
str,
|
||||||
|
],
|
||||||
|
]
|
||||||
|
],
|
||||||
|
int,
|
||||||
|
]
|
||||||
|
],
|
||||||
|
List[str],
|
||||||
|
bool,
|
||||||
|
str,
|
||||||
|
],
|
||||||
|
]
|
||||||
|
],
|
||||||
|
List[str],
|
||||||
bool,
|
bool,
|
||||||
str,
|
str,
|
||||||
],
|
],
|
||||||
@@ -924,47 +615,7 @@ class BaseRenderer:
|
|||||||
str,
|
str,
|
||||||
Union[
|
Union[
|
||||||
Dict[Any, Any],
|
Dict[Any, Any],
|
||||||
List[
|
List[Dict[str, Union[Dict[str, str], bool, str]]],
|
||||||
Union[
|
|
||||||
Tuple[
|
|
||||||
None,
|
|
||||||
List[
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
Dict[Any, Any], bool, str
|
|
||||||
],
|
|
||||||
]
|
|
||||||
],
|
|
||||||
int,
|
|
||||||
],
|
|
||||||
Tuple[
|
|
||||||
str,
|
|
||||||
List[
|
|
||||||
Union[
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
Dict[Any, Any],
|
|
||||||
bool,
|
|
||||||
str,
|
|
||||||
],
|
|
||||||
],
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
Dict[str, bool],
|
|
||||||
bool,
|
|
||||||
str,
|
|
||||||
],
|
|
||||||
],
|
|
||||||
]
|
|
||||||
],
|
|
||||||
int,
|
|
||||||
],
|
|
||||||
]
|
|
||||||
],
|
|
||||||
List[str],
|
|
||||||
bool,
|
bool,
|
||||||
str,
|
str,
|
||||||
],
|
],
|
||||||
@@ -1000,47 +651,8 @@ class BaseRenderer:
|
|||||||
Dict[
|
Dict[
|
||||||
str,
|
str,
|
||||||
Union[
|
Union[
|
||||||
Dict[str, Union[bool, str]],
|
Dict[str, str],
|
||||||
List[
|
List[Dict[str, Union[Dict[str, str], bool, str]]],
|
||||||
Union[
|
|
||||||
Tuple[
|
|
||||||
None,
|
|
||||||
List[
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
Dict[Any, Any], bool, str
|
|
||||||
],
|
|
||||||
]
|
|
||||||
],
|
|
||||||
int,
|
|
||||||
],
|
|
||||||
Tuple[
|
|
||||||
None,
|
|
||||||
List[
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
Dict[str, bool], bool, str
|
|
||||||
],
|
|
||||||
]
|
|
||||||
],
|
|
||||||
int,
|
|
||||||
],
|
|
||||||
Tuple[
|
|
||||||
str,
|
|
||||||
List[
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
Dict[Any, Any], bool, str
|
|
||||||
],
|
|
||||||
]
|
|
||||||
],
|
|
||||||
int,
|
|
||||||
],
|
|
||||||
]
|
|
||||||
],
|
|
||||||
List[str],
|
List[str],
|
||||||
bool,
|
bool,
|
||||||
str,
|
str,
|
||||||
@@ -1056,8 +668,18 @@ class BaseRenderer:
|
|||||||
str,
|
str,
|
||||||
Union[
|
Union[
|
||||||
Dict[str, str],
|
Dict[str, str],
|
||||||
List[Dict[str, Union[Dict[str, str], bool, str]]],
|
List[
|
||||||
List[str],
|
Tuple[
|
||||||
|
None,
|
||||||
|
List[
|
||||||
|
Dict[
|
||||||
|
str,
|
||||||
|
Union[Dict[str, str], bool, str],
|
||||||
|
]
|
||||||
|
],
|
||||||
|
int,
|
||||||
|
]
|
||||||
|
],
|
||||||
bool,
|
bool,
|
||||||
str,
|
str,
|
||||||
],
|
],
|
||||||
@@ -1065,6 +687,51 @@ class BaseRenderer:
|
|||||||
str,
|
str,
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
|
Dict[
|
||||||
|
str,
|
||||||
|
Union[
|
||||||
|
Dict[
|
||||||
|
str,
|
||||||
|
Union[
|
||||||
|
Dict[str, str],
|
||||||
|
List[
|
||||||
|
Union[
|
||||||
|
Tuple[
|
||||||
|
List[
|
||||||
|
Dict[
|
||||||
|
str,
|
||||||
|
Union[
|
||||||
|
Dict[str, str], bool, str
|
||||||
|
],
|
||||||
|
]
|
||||||
|
],
|
||||||
|
int,
|
||||||
|
int,
|
||||||
|
],
|
||||||
|
Tuple[
|
||||||
|
str,
|
||||||
|
List[
|
||||||
|
Dict[
|
||||||
|
str,
|
||||||
|
Union[
|
||||||
|
Dict[str, Union[bool, str]],
|
||||||
|
bool,
|
||||||
|
str,
|
||||||
|
],
|
||||||
|
]
|
||||||
|
],
|
||||||
|
int,
|
||||||
|
],
|
||||||
|
]
|
||||||
|
],
|
||||||
|
List[str],
|
||||||
|
bool,
|
||||||
|
str,
|
||||||
|
],
|
||||||
|
],
|
||||||
|
List[Dict[str, str]],
|
||||||
|
],
|
||||||
|
],
|
||||||
Dict[str, Union[bool, str]],
|
Dict[str, Union[bool, str]],
|
||||||
],
|
],
|
||||||
request: None = ...,
|
request: None = ...,
|
||||||
|
|||||||
+273
-991
File diff suppressed because it is too large
Load Diff
@@ -3,7 +3,6 @@ from typing import Any, Dict, Iterator, List, Optional, Tuple, Union
|
|||||||
|
|
||||||
from django.core.handlers.wsgi import WSGIRequest
|
from django.core.handlers.wsgi import WSGIRequest
|
||||||
from django.http.request import QueryDict
|
from django.http.request import QueryDict
|
||||||
from django.test.client import FakePayload
|
|
||||||
from django.utils.datastructures import ImmutableList, MultiValueDict
|
from django.utils.datastructures import ImmutableList, MultiValueDict
|
||||||
|
|
||||||
|
|
||||||
@@ -13,12 +12,7 @@ class InputStreamExhausted(Exception): ...
|
|||||||
class MultiPartParser:
|
class MultiPartParser:
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
META: Dict[
|
META: Dict[str, Any],
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
Dict[str, str], Tuple[int, int], BytesIO, FakePayload, int, str
|
|
||||||
],
|
|
||||||
],
|
|
||||||
input_data: Union[BytesIO, StringIO, WSGIRequest],
|
input_data: Union[BytesIO, StringIO, WSGIRequest],
|
||||||
upload_handlers: Union[List[Any], ImmutableList],
|
upload_handlers: Union[List[Any], ImmutableList],
|
||||||
encoding: Optional[str] = ...,
|
encoding: Optional[str] = ...,
|
||||||
@@ -73,7 +67,6 @@ class Parser:
|
|||||||
Tuple[
|
Tuple[
|
||||||
str,
|
str,
|
||||||
Union[
|
Union[
|
||||||
Dict[Any, Any],
|
|
||||||
Dict[str, Union[bytes, str]],
|
Dict[str, Union[bytes, str]],
|
||||||
Dict[str, bytes],
|
Dict[str, bytes],
|
||||||
Dict[str, str],
|
Dict[str, str],
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ from io import BytesIO
|
|||||||
from typing import Any, Dict, Iterator, List, Optional, Tuple, Union
|
from typing import Any, Dict, Iterator, List, Optional, Tuple, Union
|
||||||
|
|
||||||
from django.core.handlers.wsgi import WSGIRequest
|
from django.core.handlers.wsgi import WSGIRequest
|
||||||
from django.test.client import FakePayload
|
|
||||||
from django.utils.datastructures import MultiValueDict
|
from django.utils.datastructures import MultiValueDict
|
||||||
|
|
||||||
RAISE_ERROR: Any
|
RAISE_ERROR: Any
|
||||||
@@ -56,14 +55,7 @@ class HttpRequest:
|
|||||||
def upload_handlers(self, upload_handlers: Any) -> None: ...
|
def upload_handlers(self, upload_handlers: Any) -> None: ...
|
||||||
upload_handlers: Any = ...
|
upload_handlers: Any = ...
|
||||||
def parse_file_upload(
|
def parse_file_upload(
|
||||||
self,
|
self, META: Dict[str, Any], post_data: Union[BytesIO, WSGIRequest]
|
||||||
META: Dict[
|
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
Dict[str, str], Tuple[int, int], BytesIO, FakePayload, int, str
|
|
||||||
],
|
|
||||||
],
|
|
||||||
post_data: Union[BytesIO, WSGIRequest],
|
|
||||||
) -> Tuple[QueryDict, MultiValueDict]: ...
|
) -> Tuple[QueryDict, MultiValueDict]: ...
|
||||||
@property
|
@property
|
||||||
def body(self) -> bytes: ...
|
def body(self) -> bytes: ...
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from io import BufferedReader, BytesIO, TextIOWrapper
|
from io import BufferedReader, BytesIO
|
||||||
from tempfile import _TemporaryFileWrapper
|
from tempfile import _TemporaryFileWrapper
|
||||||
from typing import Any, Dict, Iterator, List, Optional, Tuple, Type, Union
|
from typing import Any, Dict, List, Optional, Tuple, Type, Union
|
||||||
from uuid import UUID
|
from uuid import UUID
|
||||||
|
|
||||||
from django.core.files.base import ContentFile
|
from django.core.files.base import ContentFile
|
||||||
@@ -93,12 +93,7 @@ class HttpResponse(HttpResponseBase):
|
|||||||
streaming: bool = ...
|
streaming: bool = ...
|
||||||
content: Any = ...
|
content: Any = ...
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self, content: Any = ..., *args: Any, **kwargs: Any
|
||||||
content: Union[
|
|
||||||
Iterator[Any], List[str], TextIOWrapper, bytes, int, str
|
|
||||||
] = ...,
|
|
||||||
*args: Any,
|
|
||||||
**kwargs: Any
|
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
def serialize(self): ...
|
def serialize(self): ...
|
||||||
__bytes__: Any = ...
|
__bytes__: Any = ...
|
||||||
@@ -127,20 +122,7 @@ class StreamingHttpResponse(HttpResponseBase):
|
|||||||
streaming: bool = ...
|
streaming: bool = ...
|
||||||
streaming_content: Any = ...
|
streaming_content: Any = ...
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self, streaming_content: Any = ..., *args: Any, **kwargs: Any
|
||||||
streaming_content: Union[
|
|
||||||
Iterator[Any],
|
|
||||||
List[bytes],
|
|
||||||
List[str],
|
|
||||||
BufferedReader,
|
|
||||||
BytesIO,
|
|
||||||
TextIOWrapper,
|
|
||||||
ContentFile,
|
|
||||||
str,
|
|
||||||
_TemporaryFileWrapper,
|
|
||||||
] = ...,
|
|
||||||
*args: Any,
|
|
||||||
**kwargs: Any
|
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
@property
|
@property
|
||||||
def content(self) -> Any: ...
|
def content(self) -> Any: ...
|
||||||
@@ -306,8 +288,9 @@ class JsonResponse(HttpResponse):
|
|||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
data: Union[
|
data: Union[
|
||||||
|
Dict[str, Dict[str, str]],
|
||||||
Dict[str, Union[Dict[str, bool], List[Dict[str, str]]]],
|
Dict[str, Union[Dict[str, bool], List[Dict[str, str]]]],
|
||||||
Dict[str, Union[Dict[str, str], int]],
|
Dict[str, int],
|
||||||
Dict[str, str],
|
Dict[str, str],
|
||||||
List[int],
|
List[int],
|
||||||
List[str],
|
List[str],
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ from django.utils.deprecation import MiddlewareMixin
|
|||||||
|
|
||||||
|
|
||||||
class UpdateCacheMiddleware(MiddlewareMixin):
|
class UpdateCacheMiddleware(MiddlewareMixin):
|
||||||
cache_timeout: Union[float, int] = ...
|
cache_timeout: float = ...
|
||||||
key_prefix: str = ...
|
key_prefix: str = ...
|
||||||
cache_alias: str = ...
|
cache_alias: str = ...
|
||||||
cache: Union[
|
cache: Union[
|
||||||
@@ -36,11 +36,11 @@ class CacheMiddleware(UpdateCacheMiddleware, FetchFromCacheMiddleware):
|
|||||||
get_response: None = ...
|
get_response: None = ...
|
||||||
key_prefix: str = ...
|
key_prefix: str = ...
|
||||||
cache_alias: str = ...
|
cache_alias: str = ...
|
||||||
cache_timeout: Union[float, int] = ...
|
cache_timeout: float = ...
|
||||||
cache: django.core.cache.backends.locmem.LocMemCache = ...
|
cache: django.core.cache.backends.locmem.LocMemCache = ...
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
get_response: None = ...,
|
get_response: None = ...,
|
||||||
cache_timeout: Optional[Union[float, int]] = ...,
|
cache_timeout: Optional[float] = ...,
|
||||||
**kwargs: Any
|
**kwargs: Any
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -39,34 +39,7 @@ class Template:
|
|||||||
context: Optional[
|
context: Optional[
|
||||||
Union[
|
Union[
|
||||||
Dict[
|
Dict[
|
||||||
str,
|
str, Dict[str, Optional[Union[Dict[str, bool], bool, str]]]
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Optional[
|
|
||||||
Union[
|
|
||||||
Dict[str, int],
|
|
||||||
List[
|
|
||||||
Tuple[
|
|
||||||
None,
|
|
||||||
List[
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
Dict[Any, Any],
|
|
||||||
time,
|
|
||||||
int,
|
|
||||||
str,
|
|
||||||
],
|
|
||||||
]
|
|
||||||
],
|
|
||||||
int,
|
|
||||||
]
|
|
||||||
],
|
|
||||||
bool,
|
|
||||||
str,
|
|
||||||
]
|
|
||||||
],
|
|
||||||
],
|
|
||||||
],
|
],
|
||||||
Dict[
|
Dict[
|
||||||
str,
|
str,
|
||||||
@@ -101,35 +74,19 @@ class Template:
|
|||||||
Union[
|
Union[
|
||||||
Dict[Any, Any],
|
Dict[Any, Any],
|
||||||
List[
|
List[
|
||||||
Union[
|
Tuple[
|
||||||
Tuple[
|
None,
|
||||||
None,
|
List[
|
||||||
List[
|
Dict[
|
||||||
Dict[
|
str,
|
||||||
|
Union[
|
||||||
|
Dict[str, bool],
|
||||||
|
bool,
|
||||||
str,
|
str,
|
||||||
Union[
|
],
|
||||||
Dict[Any, Any],
|
]
|
||||||
bool,
|
|
||||||
str,
|
|
||||||
],
|
|
||||||
]
|
|
||||||
],
|
|
||||||
int,
|
|
||||||
],
|
|
||||||
Tuple[
|
|
||||||
None,
|
|
||||||
List[
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
Dict[str, bool],
|
|
||||||
bool,
|
|
||||||
str,
|
|
||||||
],
|
|
||||||
]
|
|
||||||
],
|
|
||||||
int,
|
|
||||||
],
|
],
|
||||||
|
int,
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
List[str],
|
List[str],
|
||||||
@@ -152,16 +109,14 @@ class Template:
|
|||||||
Dict[Any, Any],
|
Dict[Any, Any],
|
||||||
List[
|
List[
|
||||||
Tuple[
|
Tuple[
|
||||||
None,
|
|
||||||
List[
|
List[
|
||||||
Dict[
|
Dict[
|
||||||
str,
|
str,
|
||||||
Union[
|
Union[Dict[Any, Any], bool, str],
|
||||||
Dict[Any, Any], bool, time, str
|
|
||||||
],
|
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
int,
|
int,
|
||||||
|
int,
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
List[str],
|
List[str],
|
||||||
@@ -196,46 +151,24 @@ class Template:
|
|||||||
str,
|
str,
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
Dict[str, Union[Dict[Any, Any], bool, str]],
|
|
||||||
Dict[
|
Dict[
|
||||||
str,
|
str,
|
||||||
Union[
|
Union[
|
||||||
Dict[str, bool],
|
Dict[str, bool],
|
||||||
List[
|
List[
|
||||||
Union[
|
Tuple[
|
||||||
Tuple[
|
None,
|
||||||
None,
|
List[
|
||||||
List[
|
Dict[
|
||||||
Dict[
|
str,
|
||||||
|
Union[
|
||||||
|
Dict[str, bool],
|
||||||
|
bool,
|
||||||
str,
|
str,
|
||||||
Union[
|
],
|
||||||
Dict[
|
]
|
||||||
Any, Any
|
|
||||||
],
|
|
||||||
bool,
|
|
||||||
str,
|
|
||||||
],
|
|
||||||
]
|
|
||||||
],
|
|
||||||
int,
|
|
||||||
],
|
|
||||||
Tuple[
|
|
||||||
None,
|
|
||||||
List[
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
bool,
|
|
||||||
],
|
|
||||||
bool,
|
|
||||||
str,
|
|
||||||
],
|
|
||||||
]
|
|
||||||
],
|
|
||||||
int,
|
|
||||||
],
|
],
|
||||||
|
int,
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
List[str],
|
List[str],
|
||||||
@@ -250,98 +183,6 @@ class Template:
|
|||||||
],
|
],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
Dict[Any, Any],
|
|
||||||
List[
|
|
||||||
Union[
|
|
||||||
Tuple[
|
|
||||||
None,
|
|
||||||
List[
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
Dict[Any, Any], bool, str
|
|
||||||
],
|
|
||||||
]
|
|
||||||
],
|
|
||||||
int,
|
|
||||||
],
|
|
||||||
Tuple[
|
|
||||||
str,
|
|
||||||
List[
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
Dict[Any, Any], bool, str
|
|
||||||
],
|
|
||||||
]
|
|
||||||
],
|
|
||||||
int,
|
|
||||||
],
|
|
||||||
]
|
|
||||||
],
|
|
||||||
List[str],
|
|
||||||
bool,
|
|
||||||
str,
|
|
||||||
],
|
|
||||||
],
|
|
||||||
],
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
Dict[Any, Any],
|
|
||||||
List[
|
|
||||||
Union[
|
|
||||||
Tuple[
|
|
||||||
None,
|
|
||||||
List[
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
Dict[Any, Any], bool, str
|
|
||||||
],
|
|
||||||
]
|
|
||||||
],
|
|
||||||
int,
|
|
||||||
],
|
|
||||||
Tuple[
|
|
||||||
str,
|
|
||||||
List[
|
|
||||||
Union[
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
Dict[Any, Any],
|
|
||||||
bool,
|
|
||||||
str,
|
|
||||||
],
|
|
||||||
],
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
Dict[str, bool],
|
|
||||||
bool,
|
|
||||||
str,
|
|
||||||
],
|
|
||||||
],
|
|
||||||
]
|
|
||||||
],
|
|
||||||
int,
|
|
||||||
],
|
|
||||||
]
|
|
||||||
],
|
|
||||||
List[str],
|
|
||||||
bool,
|
|
||||||
str,
|
|
||||||
],
|
|
||||||
],
|
|
||||||
],
|
|
||||||
Dict[
|
Dict[
|
||||||
str,
|
str,
|
||||||
Dict[
|
Dict[
|
||||||
@@ -389,31 +230,15 @@ class Template:
|
|||||||
Union[
|
Union[
|
||||||
Dict[str, bool],
|
Dict[str, bool],
|
||||||
List[
|
List[
|
||||||
Union[
|
Tuple[
|
||||||
Tuple[
|
List[
|
||||||
None,
|
Dict[
|
||||||
List[
|
str,
|
||||||
Dict[
|
Union[Dict[str, bool], bool, str],
|
||||||
str,
|
]
|
||||||
Union[
|
|
||||||
Dict[Any, Any], bool, str
|
|
||||||
],
|
|
||||||
]
|
|
||||||
],
|
|
||||||
int,
|
|
||||||
],
|
|
||||||
Tuple[
|
|
||||||
None,
|
|
||||||
List[
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
Dict[str, bool], bool, str
|
|
||||||
],
|
|
||||||
]
|
|
||||||
],
|
|
||||||
int,
|
|
||||||
],
|
],
|
||||||
|
int,
|
||||||
|
int,
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
List[str],
|
List[str],
|
||||||
@@ -429,43 +254,41 @@ class Template:
|
|||||||
Union[
|
Union[
|
||||||
Dict[str, bool],
|
Dict[str, bool],
|
||||||
List[
|
List[
|
||||||
Union[
|
Tuple[
|
||||||
Tuple[
|
None,
|
||||||
None,
|
List[
|
||||||
List[
|
Dict[
|
||||||
Dict[
|
str,
|
||||||
str,
|
Union[Dict[str, bool], int, str],
|
||||||
Union[
|
]
|
||||||
Dict[str, bool], bool, str
|
|
||||||
],
|
|
||||||
]
|
|
||||||
],
|
|
||||||
int,
|
|
||||||
],
|
],
|
||||||
Tuple[
|
int,
|
||||||
str,
|
]
|
||||||
List[
|
],
|
||||||
|
List[str],
|
||||||
|
bool,
|
||||||
|
str,
|
||||||
|
],
|
||||||
|
],
|
||||||
|
],
|
||||||
|
Dict[
|
||||||
|
str,
|
||||||
|
Dict[
|
||||||
|
str,
|
||||||
|
Union[
|
||||||
|
Dict[str, int],
|
||||||
|
List[
|
||||||
|
Tuple[
|
||||||
|
None,
|
||||||
|
List[
|
||||||
|
Dict[
|
||||||
|
str,
|
||||||
Union[
|
Union[
|
||||||
Dict[
|
Dict[Any, Any], time, int, str
|
||||||
str,
|
],
|
||||||
Union[
|
]
|
||||||
Dict[Any, Any],
|
|
||||||
bool,
|
|
||||||
str,
|
|
||||||
],
|
|
||||||
],
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
Dict[str, bool],
|
|
||||||
bool,
|
|
||||||
str,
|
|
||||||
],
|
|
||||||
],
|
|
||||||
]
|
|
||||||
],
|
|
||||||
int,
|
|
||||||
],
|
],
|
||||||
|
int,
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
List[str],
|
List[str],
|
||||||
@@ -494,29 +317,43 @@ class Template:
|
|||||||
Union[
|
Union[
|
||||||
Dict[str, str],
|
Dict[str, str],
|
||||||
List[
|
List[
|
||||||
Union[
|
Tuple[
|
||||||
Tuple[
|
None,
|
||||||
None,
|
List[
|
||||||
List[
|
Dict[
|
||||||
Dict[
|
str,
|
||||||
|
Union[
|
||||||
|
Dict[str, Union[bool, str]],
|
||||||
|
bool,
|
||||||
str,
|
str,
|
||||||
Union[Dict[Any, Any], int, str],
|
],
|
||||||
]
|
]
|
||||||
],
|
|
||||||
int,
|
|
||||||
],
|
],
|
||||||
Tuple[
|
int,
|
||||||
None,
|
]
|
||||||
List[
|
],
|
||||||
Dict[
|
List[str],
|
||||||
str,
|
bool,
|
||||||
Union[
|
str,
|
||||||
Dict[str, bool], int, str
|
],
|
||||||
],
|
],
|
||||||
]
|
],
|
||||||
],
|
Dict[
|
||||||
int,
|
str,
|
||||||
|
Dict[
|
||||||
|
str,
|
||||||
|
Union[
|
||||||
|
Dict[str, str],
|
||||||
|
List[
|
||||||
|
Tuple[
|
||||||
|
None,
|
||||||
|
List[
|
||||||
|
Dict[
|
||||||
|
str,
|
||||||
|
Union[Dict[str, bool], int, str],
|
||||||
|
]
|
||||||
],
|
],
|
||||||
|
int,
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
List[str],
|
List[str],
|
||||||
@@ -534,7 +371,19 @@ class Template:
|
|||||||
List[
|
List[
|
||||||
Union[
|
Union[
|
||||||
Tuple[
|
Tuple[
|
||||||
None,
|
List[
|
||||||
|
Dict[
|
||||||
|
str,
|
||||||
|
Union[
|
||||||
|
Dict[str, str], bool, str
|
||||||
|
],
|
||||||
|
]
|
||||||
|
],
|
||||||
|
int,
|
||||||
|
int,
|
||||||
|
],
|
||||||
|
Tuple[
|
||||||
|
str,
|
||||||
List[
|
List[
|
||||||
Dict[
|
Dict[
|
||||||
str,
|
str,
|
||||||
@@ -547,13 +396,41 @@ class Template:
|
|||||||
],
|
],
|
||||||
int,
|
int,
|
||||||
],
|
],
|
||||||
|
]
|
||||||
|
],
|
||||||
|
List[str],
|
||||||
|
bool,
|
||||||
|
str,
|
||||||
|
],
|
||||||
|
],
|
||||||
|
],
|
||||||
|
Dict[
|
||||||
|
str,
|
||||||
|
Dict[
|
||||||
|
str,
|
||||||
|
Union[
|
||||||
|
Dict[str, str],
|
||||||
|
List[
|
||||||
|
Union[
|
||||||
Tuple[
|
Tuple[
|
||||||
None,
|
None,
|
||||||
List[
|
List[
|
||||||
Dict[
|
Dict[
|
||||||
str,
|
str,
|
||||||
Union[
|
Union[
|
||||||
Dict[str, str], bool, str
|
Dict[Any, Any], bool, str
|
||||||
|
],
|
||||||
|
]
|
||||||
|
],
|
||||||
|
int,
|
||||||
|
],
|
||||||
|
Tuple[
|
||||||
|
str,
|
||||||
|
List[
|
||||||
|
Dict[
|
||||||
|
str,
|
||||||
|
Union[
|
||||||
|
Dict[str, bool], bool, str
|
||||||
],
|
],
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
@@ -593,34 +470,9 @@ class Template:
|
|||||||
Dict[
|
Dict[
|
||||||
str,
|
str,
|
||||||
Union[
|
Union[
|
||||||
Dict[str, str], bool, str
|
Dict[str, Union[bool, str]],
|
||||||
],
|
bool,
|
||||||
]
|
|
||||||
],
|
|
||||||
int,
|
|
||||||
],
|
|
||||||
Tuple[
|
|
||||||
str,
|
|
||||||
List[
|
|
||||||
Union[
|
|
||||||
Dict[
|
|
||||||
str,
|
str,
|
||||||
Union[
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[bool, str],
|
|
||||||
],
|
|
||||||
bool,
|
|
||||||
str,
|
|
||||||
],
|
|
||||||
],
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
Dict[str, str],
|
|
||||||
bool,
|
|
||||||
str,
|
|
||||||
],
|
|
||||||
],
|
],
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1,46 +1,9 @@
|
|||||||
from datetime import date, datetime, time, timedelta
|
from datetime import date, time, timedelta
|
||||||
from decimal import Decimal
|
from decimal import Decimal
|
||||||
from io import BytesIO
|
from typing import Any, Callable, Dict, Iterator, List, Optional, Tuple, Union
|
||||||
from sqlite3 import OperationalError
|
|
||||||
from typing import (Any, Callable, Dict, Iterator, List, Optional, Tuple, Type,
|
|
||||||
Union)
|
|
||||||
|
|
||||||
from django.contrib.admin.helpers import AdminErrorList
|
|
||||||
from django.contrib.admin.options import ModelAdmin
|
|
||||||
from django.contrib.admin.templatetags.admin_list import ResultList
|
|
||||||
from django.contrib.admin.templatetags.base import InclusionAdminNode
|
|
||||||
from django.contrib.admin.views.main import ChangeList
|
|
||||||
from django.contrib.auth.views import LoginView
|
|
||||||
from django.core.files.uploadedfile import InMemoryUploadedFile
|
|
||||||
from django.core.files.uploadhandler import FileUploadHandler
|
|
||||||
from django.core.handlers.wsgi import WSGIRequest
|
|
||||||
from django.db.backends.sqlite3.base import (DatabaseWrapper,
|
|
||||||
SQLiteCursorWrapper)
|
|
||||||
from django.db.backends.utils import CursorWrapper
|
|
||||||
from django.db.models.base import Model
|
|
||||||
from django.db.models.options import Options
|
|
||||||
from django.db.models.query import QuerySet
|
from django.db.models.query import QuerySet
|
||||||
from django.db.utils import OperationalError
|
|
||||||
from django.http.multipartparser import LazyStream, MultiPartParser
|
|
||||||
from django.http.response import HttpResponse
|
|
||||||
from django.template.backends.django import DjangoTemplates, Template
|
|
||||||
from django.template.base import Node, Template
|
|
||||||
from django.template.context import RequestContext
|
|
||||||
from django.template.exceptions import TemplateDoesNotExist
|
|
||||||
from django.template.loader_tags import BlockContext, BlockNode
|
|
||||||
from django.test.client import FakePayload, RequestFactory
|
|
||||||
from django.urls.resolvers import ResolverMatch, URLResolver
|
|
||||||
from django.utils.datastructures import MultiValueDict
|
|
||||||
from django.utils.feedgenerator import Enclosure, Rss201rev2Feed
|
|
||||||
from django.utils.functional import cached_property
|
|
||||||
from django.utils.safestring import SafeText
|
from django.utils.safestring import SafeText
|
||||||
from django.utils.xmlutils import SimplerXMLGenerator
|
|
||||||
from django.views.debug import CallableSettingWrapper, ExceptionReporter
|
|
||||||
from django.views.generic.base import TemplateResponseMixin, TemplateView
|
|
||||||
from django.views.generic.dates import BaseDateDetailView
|
|
||||||
from django.views.generic.detail import DetailView
|
|
||||||
from django.views.generic.edit import DeleteView, ModelFormMixin
|
|
||||||
from django.views.generic.list import MultipleObjectTemplateResponseMixin
|
|
||||||
|
|
||||||
from .base import Variable, VariableDoesNotExist
|
from .base import Variable, VariableDoesNotExist
|
||||||
from .library import Library
|
from .library import Library
|
||||||
@@ -53,7 +16,7 @@ def capfirst(value: str) -> str: ...
|
|||||||
def escapejs_filter(value: str) -> SafeText: ...
|
def escapejs_filter(value: str) -> SafeText: ...
|
||||||
def json_script(value: Dict[str, str], element_id: SafeText) -> SafeText: ...
|
def json_script(value: Dict[str, str], element_id: SafeText) -> SafeText: ...
|
||||||
def floatformat(
|
def floatformat(
|
||||||
text: Optional[Union[Decimal, float, int, str]], arg: Union[int, str] = ...
|
text: Optional[Union[Decimal, float, str]], arg: Union[int, str] = ...
|
||||||
) -> str: ...
|
) -> str: ...
|
||||||
def iriencode(value: str) -> str: ...
|
def iriencode(value: str) -> str: ...
|
||||||
def linenumbers(value: str, autoescape: bool = ...) -> SafeText: ...
|
def linenumbers(value: str, autoescape: bool = ...) -> SafeText: ...
|
||||||
@@ -119,26 +82,11 @@ def last(value: List[str]) -> str: ...
|
|||||||
def length(
|
def length(
|
||||||
value: Optional[
|
value: Optional[
|
||||||
Union[
|
Union[
|
||||||
List[Optional[Union[Dict[Any, Any], int, str]]],
|
List[Optional[Union[Dict[Any, Any], int, str]]], QuerySet, int, str
|
||||||
AdminErrorList,
|
|
||||||
QuerySet,
|
|
||||||
int,
|
|
||||||
str,
|
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
) -> int: ...
|
) -> int: ...
|
||||||
def length_is(
|
def length_is(value: Any, arg: Union[SafeText, int]) -> Union[bool, str]: ...
|
||||||
value: Optional[
|
|
||||||
Union[
|
|
||||||
List[Callable],
|
|
||||||
List[Optional[Union[Dict[Any, Any], int, str]]],
|
|
||||||
Tuple[str, str],
|
|
||||||
int,
|
|
||||||
str,
|
|
||||||
]
|
|
||||||
],
|
|
||||||
arg: Union[SafeText, int],
|
|
||||||
) -> Union[bool, str]: ...
|
|
||||||
def random(value: List[str]) -> str: ...
|
def random(value: List[str]) -> str: ...
|
||||||
def slice_filter(value: Any, arg: str) -> Any: ...
|
def slice_filter(value: Any, arg: str) -> Any: ...
|
||||||
def unordered_list(
|
def unordered_list(
|
||||||
@@ -179,118 +127,4 @@ def yesno(
|
|||||||
def filesizeformat(bytes_: Union[complex, int, str]) -> str: ...
|
def filesizeformat(bytes_: Union[complex, int, str]) -> str: ...
|
||||||
def pluralize(value: Any, arg: str = ...) -> str: ...
|
def pluralize(value: Any, arg: str = ...) -> str: ...
|
||||||
def phone2numeric_filter(value: str) -> str: ...
|
def phone2numeric_filter(value: str) -> str: ...
|
||||||
def pprint(
|
def pprint(value: Any) -> str: ...
|
||||||
value: Optional[
|
|
||||||
Union[
|
|
||||||
Callable,
|
|
||||||
Dict[int, None],
|
|
||||||
Dict[
|
|
||||||
str, Optional[Union[List[Enclosure], List[str], datetime, str]]
|
|
||||||
],
|
|
||||||
Dict[str, Optional[Union[TemplateResponseMixin, int]]],
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Optional[
|
|
||||||
Union[Dict[Any, Any], Dict[str, None], int, str]
|
|
||||||
],
|
|
||||||
],
|
|
||||||
Tuple[str, Dict[str, bytes]],
|
|
||||||
],
|
|
||||||
],
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
Dict[str, Union[List[str], bool, str]],
|
|
||||||
Dict[str, Union[List[str], str]],
|
|
||||||
],
|
|
||||||
],
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[Dict[str, Union[List[str], str]], Dict[str, str]],
|
|
||||||
],
|
|
||||||
date,
|
|
||||||
int,
|
|
||||||
],
|
|
||||||
],
|
|
||||||
Dict[str, Union[Dict[str, str], str]],
|
|
||||||
Dict[str, Union[Tuple[int, int], BytesIO, FakePayload, int, str]],
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[django.db.backends.base.DatabaseWrapper, CursorWrapper],
|
|
||||||
],
|
|
||||||
Dict[str, bytes],
|
|
||||||
Dict[str, Model],
|
|
||||||
Dict[str, BlockNode],
|
|
||||||
Exception,
|
|
||||||
List[Callable],
|
|
||||||
List[Dict[str, Union[Dict[str, List[str]], List[str], bool, str]]],
|
|
||||||
List[Tuple[str, str]],
|
|
||||||
List[ChangeList],
|
|
||||||
List[DjangoTemplates],
|
|
||||||
List[TemplateDoesNotExist],
|
|
||||||
List[Enclosure],
|
|
||||||
List[int],
|
|
||||||
List[str],
|
|
||||||
Tuple,
|
|
||||||
Type[
|
|
||||||
Union[
|
|
||||||
ValueError,
|
|
||||||
bool,
|
|
||||||
ResultList,
|
|
||||||
InclusionAdminNode,
|
|
||||||
LoginView,
|
|
||||||
OperationalError,
|
|
||||||
URLResolver,
|
|
||||||
MultiValueDict,
|
|
||||||
TemplateView,
|
|
||||||
BaseDateDetailView,
|
|
||||||
DetailView,
|
|
||||||
DeleteView,
|
|
||||||
ModelFormMixin,
|
|
||||||
MultipleObjectTemplateResponseMixin,
|
|
||||||
OperationalError,
|
|
||||||
]
|
|
||||||
],
|
|
||||||
BytesIO,
|
|
||||||
bytes,
|
|
||||||
date,
|
|
||||||
ModelAdmin,
|
|
||||||
ChangeList,
|
|
||||||
InMemoryUploadedFile,
|
|
||||||
FileUploadHandler,
|
|
||||||
WSGIRequest,
|
|
||||||
django.db.backends.base.SQLiteCursorWrapper,
|
|
||||||
CursorWrapper,
|
|
||||||
Model,
|
|
||||||
Options,
|
|
||||||
QuerySet,
|
|
||||||
LazyStream,
|
|
||||||
MultiPartParser,
|
|
||||||
HttpResponse,
|
|
||||||
DjangoTemplates,
|
|
||||||
Template,
|
|
||||||
Node,
|
|
||||||
Template,
|
|
||||||
RequestContext,
|
|
||||||
BlockContext,
|
|
||||||
FakePayload,
|
|
||||||
RequestFactory,
|
|
||||||
ResolverMatch,
|
|
||||||
URLResolver,
|
|
||||||
Rss201rev2Feed,
|
|
||||||
cached_property,
|
|
||||||
SimplerXMLGenerator,
|
|
||||||
CallableSettingWrapper,
|
|
||||||
ExceptionReporter,
|
|
||||||
TemplateResponseMixin,
|
|
||||||
int,
|
|
||||||
str,
|
|
||||||
]
|
|
||||||
]
|
|
||||||
) -> str: ...
|
|
||||||
|
|||||||
@@ -1,24 +1,10 @@
|
|||||||
from collections import namedtuple
|
from collections import namedtuple
|
||||||
from datetime import date, time
|
from datetime import date
|
||||||
from decimal import Decimal
|
from typing import Any, Dict, List, Optional, Tuple, Union
|
||||||
from sqlite3 import OperationalError
|
|
||||||
from typing import Any, Dict, List, Optional, Set, Tuple, Union
|
|
||||||
|
|
||||||
from django.contrib.admin.helpers import ActionForm, AdminForm
|
|
||||||
from django.contrib.auth.context_processors import PermLookupDict, PermWrapper
|
|
||||||
from django.contrib.messages.storage.base import BaseStorage
|
|
||||||
from django.core.exceptions import FieldDoesNotExist
|
|
||||||
from django.core.handlers.wsgi import WSGIRequest
|
|
||||||
from django.db.models.base import Model
|
|
||||||
from django.db.models.fields import AutoField
|
|
||||||
from django.db.models.query import QuerySet
|
|
||||||
from django.forms.boundfield import BoundField
|
|
||||||
from django.template.base import FilterExpression, NodeList, Parser, Token
|
from django.template.base import FilterExpression, NodeList, Parser, Token
|
||||||
from django.template.context import Context, RequestContext
|
from django.template.context import Context, RequestContext
|
||||||
from django.template.exceptions import TemplateDoesNotExist
|
|
||||||
from django.template.library import Library
|
from django.template.library import Library
|
||||||
from django.urls.resolvers import URLPattern, URLResolver
|
|
||||||
from django.utils.datastructures import MultiValueDict
|
|
||||||
from django.utils.safestring import SafeText
|
from django.utils.safestring import SafeText
|
||||||
|
|
||||||
from .base import (BLOCK_TAG_END, BLOCK_TAG_START, COMMENT_TAG_END,
|
from .base import (BLOCK_TAG_END, BLOCK_TAG_START, COMMENT_TAG_END,
|
||||||
@@ -144,19 +130,10 @@ class IfNode(Node):
|
|||||||
origin: django.template.base.Origin
|
origin: django.template.base.Origin
|
||||||
token: django.template.base.Token
|
token: django.template.base.Token
|
||||||
conditions_nodelists: List[
|
conditions_nodelists: List[
|
||||||
Union[
|
Tuple[django.template.base.NodeList, django.template.base.NodeList]
|
||||||
Tuple[None, django.template.base.NodeList],
|
|
||||||
Tuple[
|
|
||||||
django.template.defaulttags.TemplateLiteral,
|
|
||||||
django.template.base.NodeList,
|
|
||||||
],
|
|
||||||
]
|
|
||||||
] = ...
|
] = ...
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self, conditions_nodelists: List[Tuple[NodeList, NodeList]]
|
||||||
conditions_nodelists: List[
|
|
||||||
Union[Tuple[None, NodeList], Tuple[TemplateLiteral, NodeList]]
|
|
||||||
],
|
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
def __iter__(self) -> None: ...
|
def __iter__(self) -> None: ...
|
||||||
@property
|
@property
|
||||||
@@ -308,50 +285,7 @@ class TemplateLiteral(Literal):
|
|||||||
text: str = ...
|
text: str = ...
|
||||||
def __init__(self, value: FilterExpression, text: str) -> None: ...
|
def __init__(self, value: FilterExpression, text: str) -> None: ...
|
||||||
def display(self) -> str: ...
|
def display(self) -> str: ...
|
||||||
def eval(
|
def eval(self, context: Context) -> Any: ...
|
||||||
self, context: Context
|
|
||||||
) -> Optional[
|
|
||||||
Union[
|
|
||||||
AttributeError,
|
|
||||||
Dict[str, Union[List[Tuple[int, SafeText]], int, str]],
|
|
||||||
KeyError,
|
|
||||||
List[List[Union[URLPattern, URLResolver]]],
|
|
||||||
List[Tuple[str, str]],
|
|
||||||
List[
|
|
||||||
Union[
|
|
||||||
Dict[str, Union[List[Any], str]],
|
|
||||||
Dict[
|
|
||||||
str, Union[List[Dict[str, Union[List[Any], str]]], str]
|
|
||||||
],
|
|
||||||
]
|
|
||||||
],
|
|
||||||
List[BoundField],
|
|
||||||
List[TemplateDoesNotExist],
|
|
||||||
List[int],
|
|
||||||
List[str],
|
|
||||||
Set[Any],
|
|
||||||
Tuple,
|
|
||||||
TypeError,
|
|
||||||
date,
|
|
||||||
time,
|
|
||||||
Decimal,
|
|
||||||
ActionForm,
|
|
||||||
AdminForm,
|
|
||||||
PermLookupDict,
|
|
||||||
PermWrapper,
|
|
||||||
BaseStorage,
|
|
||||||
FieldDoesNotExist,
|
|
||||||
WSGIRequest,
|
|
||||||
Model,
|
|
||||||
AutoField,
|
|
||||||
QuerySet,
|
|
||||||
MultiValueDict,
|
|
||||||
float,
|
|
||||||
int,
|
|
||||||
OperationalError,
|
|
||||||
str,
|
|
||||||
]
|
|
||||||
]: ...
|
|
||||||
|
|
||||||
class TemplateIfParser(IfParser):
|
class TemplateIfParser(IfParser):
|
||||||
current_token: django.template.defaulttags.TemplateLiteral
|
current_token: django.template.defaulttags.TemplateLiteral
|
||||||
|
|||||||
@@ -29,7 +29,6 @@ class Engine:
|
|||||||
str,
|
str,
|
||||||
Union[
|
Union[
|
||||||
Dict[str, str],
|
Dict[str, str],
|
||||||
List[Any],
|
|
||||||
List[Tuple[str, Dict[str, str]]],
|
List[Tuple[str, Dict[str, str]]],
|
||||||
List[str],
|
List[str],
|
||||||
],
|
],
|
||||||
@@ -59,7 +58,6 @@ class Engine:
|
|||||||
str,
|
str,
|
||||||
Union[
|
Union[
|
||||||
Dict[str, str],
|
Dict[str, str],
|
||||||
List[Any],
|
|
||||||
List[Tuple[str, Dict[str, str]]],
|
List[Tuple[str, Dict[str, str]]],
|
||||||
List[str],
|
List[str],
|
||||||
],
|
],
|
||||||
@@ -93,7 +91,6 @@ class Engine:
|
|||||||
str,
|
str,
|
||||||
Union[
|
Union[
|
||||||
Dict[str, str],
|
Dict[str, str],
|
||||||
List[Any],
|
|
||||||
List[Tuple[str, Dict[str, str]]],
|
List[Tuple[str, Dict[str, str]]],
|
||||||
List[str],
|
List[str],
|
||||||
],
|
],
|
||||||
@@ -133,10 +130,9 @@ class Engine:
|
|||||||
Dict[str, Dict[str, List[Tuple[str, int]]]],
|
Dict[str, Dict[str, List[Tuple[str, int]]]],
|
||||||
Dict[str, Dict[str, Tuple[str, str, str, str]]],
|
Dict[str, Dict[str, Tuple[str, str, str, str]]],
|
||||||
Dict[str, List[Dict[str, Union[List[int], int]]]],
|
Dict[str, List[Dict[str, Union[List[int], int]]]],
|
||||||
Dict[str, List[Dict[str, Union[List[str], str]]]],
|
|
||||||
Dict[str, List[Dict[str, Union[int, str]]]],
|
Dict[str, List[Dict[str, Union[int, str]]]],
|
||||||
Dict[str, List[Dict[str, date]]],
|
|
||||||
Dict[str, List[List[Tuple[int, str]]]],
|
Dict[str, List[List[Tuple[int, str]]]],
|
||||||
|
Dict[str, List[Union[List[SafeText], str]]],
|
||||||
Dict[str, List[Template]],
|
Dict[str, List[Template]],
|
||||||
Dict[str, Optional[int]],
|
Dict[str, Optional[int]],
|
||||||
Dict[str, Optional[str]],
|
Dict[str, Optional[str]],
|
||||||
@@ -155,15 +151,28 @@ class Engine:
|
|||||||
Dict[str, Union[Dict[str, int], str]],
|
Dict[str, Union[Dict[str, int], str]],
|
||||||
Dict[
|
Dict[
|
||||||
str,
|
str,
|
||||||
Union[List[Optional[Union[Dict[Any, Any], int, str]]], int],
|
Union[
|
||||||
|
List[
|
||||||
|
Optional[
|
||||||
|
Union[
|
||||||
|
Dict[str, Union[List[str], str]], int, str
|
||||||
|
]
|
||||||
|
]
|
||||||
|
],
|
||||||
|
str,
|
||||||
|
],
|
||||||
|
],
|
||||||
|
Dict[
|
||||||
|
str,
|
||||||
|
Union[
|
||||||
|
List[Optional[Union[Dict[str, date], int, str]]], int
|
||||||
|
],
|
||||||
],
|
],
|
||||||
Dict[str, Union[List[Union[List[SafeText], str]], str]],
|
|
||||||
Dict[str, Union[List[int], str]],
|
|
||||||
Dict[str, Union[date, timedelta]],
|
Dict[str, Union[date, timedelta]],
|
||||||
Dict[str, Union[float, int]],
|
|
||||||
Dict[str, Union[int, str]],
|
Dict[str, Union[int, str]],
|
||||||
Dict[str, time],
|
Dict[str, time],
|
||||||
Dict[str, Template],
|
Dict[str, Template],
|
||||||
|
Dict[str, float],
|
||||||
Dict[str, range],
|
Dict[str, range],
|
||||||
]
|
]
|
||||||
] = ...,
|
] = ...,
|
||||||
|
|||||||
@@ -55,9 +55,9 @@ class TagHelperNode(Node):
|
|||||||
) -> None: ...
|
) -> None: ...
|
||||||
def get_resolved_arguments(
|
def get_resolved_arguments(
|
||||||
self, context: Context
|
self, context: Context
|
||||||
) -> Union[
|
) -> Tuple[
|
||||||
Tuple[Dict[Any, Any], Dict[Any, Any]],
|
Union[Dict[str, Union[SafeText, int]], List[Union[Context, int]]],
|
||||||
Tuple[List[int], Dict[str, Union[SafeText, int]]],
|
Union[Dict[Any, Any], Dict[str, Union[SafeText, int]], Dict[str, int]],
|
||||||
]: ...
|
]: ...
|
||||||
|
|
||||||
class SimpleNode(TagHelperNode):
|
class SimpleNode(TagHelperNode):
|
||||||
|
|||||||
@@ -1,11 +1,12 @@
|
|||||||
from datetime import date, datetime
|
from datetime import datetime
|
||||||
from typing import Any, Callable, Dict, List, Optional, Tuple, Union
|
from typing import Any, Callable, Dict, List, Optional, Tuple, Union
|
||||||
from unittest.mock import MagicMock
|
from unittest.mock import MagicMock
|
||||||
|
|
||||||
|
from django.contrib.auth.forms import AuthenticationForm
|
||||||
|
from django.contrib.auth.views import LoginView
|
||||||
from django.contrib.sites.requests import RequestSite
|
from django.contrib.sites.requests import RequestSite
|
||||||
from django.core.paginator import Page, Paginator
|
from django.core.paginator import Page, Paginator
|
||||||
from django.db.models.base import Model
|
from django.db.models.base import Model
|
||||||
from django.db.models.query import QuerySet
|
|
||||||
from django.forms.forms import BaseForm
|
from django.forms.forms import BaseForm
|
||||||
from django.http import HttpResponse
|
from django.http import HttpResponse
|
||||||
from django.http.request import HttpRequest
|
from django.http.request import HttpRequest
|
||||||
@@ -13,8 +14,7 @@ from django.template.backends.django import Template
|
|||||||
from django.template.backends.jinja2 import Template
|
from django.template.backends.jinja2 import Template
|
||||||
from django.views.generic.base import TemplateResponseMixin
|
from django.views.generic.base import TemplateResponseMixin
|
||||||
from django.views.generic.detail import DetailView
|
from django.views.generic.detail import DetailView
|
||||||
from django.views.generic.list import (ListView,
|
from django.views.generic.list import ListView
|
||||||
MultipleObjectTemplateResponseMixin)
|
|
||||||
|
|
||||||
from .loader import get_template, select_template
|
from .loader import get_template, select_template
|
||||||
|
|
||||||
@@ -38,19 +38,17 @@ class SimpleTemplateResponse(HttpResponse):
|
|||||||
template: Union[List[str], Template, str],
|
template: Union[List[str], Template, str],
|
||||||
context: Optional[
|
context: Optional[
|
||||||
Union[
|
Union[
|
||||||
Dict[
|
Dict[str, Any],
|
||||||
str, Optional[Union[List[Dict[str, str]], bool, ListView]]
|
Dict[str, List[Dict[str, Any]]],
|
||||||
],
|
|
||||||
Dict[
|
Dict[
|
||||||
str,
|
str,
|
||||||
Optional[
|
Optional[
|
||||||
Union[
|
Union[
|
||||||
|
List[
|
||||||
|
Dict[str, Optional[Union[datetime, Model, str]]]
|
||||||
|
],
|
||||||
bool,
|
bool,
|
||||||
date,
|
ListView,
|
||||||
Page,
|
|
||||||
Paginator,
|
|
||||||
QuerySet,
|
|
||||||
MultipleObjectTemplateResponseMixin,
|
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
@@ -59,17 +57,12 @@ class SimpleTemplateResponse(HttpResponse):
|
|||||||
Dict[
|
Dict[
|
||||||
str,
|
str,
|
||||||
Union[
|
Union[
|
||||||
List[Dict[str, Optional[Union[datetime, Model, str]]]],
|
List[Dict[str, str]], bool, Page, Paginator, ListView
|
||||||
bool,
|
|
||||||
Page,
|
|
||||||
Paginator,
|
|
||||||
ListView,
|
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
Dict[str, Union[List[str], str]],
|
Dict[str, Union[List[str], str]],
|
||||||
Dict[
|
Dict[
|
||||||
str,
|
str, Union[AuthenticationForm, LoginView, RequestSite, str]
|
||||||
Union[RequestSite, BaseForm, TemplateResponseMixin, str],
|
|
||||||
],
|
],
|
||||||
Dict[str, Union[Model, BaseForm, TemplateResponseMixin, str]],
|
Dict[str, Union[Model, BaseForm, TemplateResponseMixin, str]],
|
||||||
MagicMock,
|
MagicMock,
|
||||||
@@ -87,19 +80,17 @@ class SimpleTemplateResponse(HttpResponse):
|
|||||||
self,
|
self,
|
||||||
context: Optional[
|
context: Optional[
|
||||||
Union[
|
Union[
|
||||||
Dict[
|
Dict[str, Any],
|
||||||
str, Optional[Union[List[Dict[str, str]], bool, ListView]]
|
Dict[str, List[Dict[str, Any]]],
|
||||||
],
|
|
||||||
Dict[
|
Dict[
|
||||||
str,
|
str,
|
||||||
Optional[
|
Optional[
|
||||||
Union[
|
Union[
|
||||||
|
List[
|
||||||
|
Dict[str, Optional[Union[datetime, Model, str]]]
|
||||||
|
],
|
||||||
bool,
|
bool,
|
||||||
date,
|
ListView,
|
||||||
Page,
|
|
||||||
Paginator,
|
|
||||||
QuerySet,
|
|
||||||
MultipleObjectTemplateResponseMixin,
|
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
@@ -108,17 +99,12 @@ class SimpleTemplateResponse(HttpResponse):
|
|||||||
Dict[
|
Dict[
|
||||||
str,
|
str,
|
||||||
Union[
|
Union[
|
||||||
List[Dict[str, Optional[Union[datetime, Model, str]]]],
|
List[Dict[str, str]], bool, Page, Paginator, ListView
|
||||||
bool,
|
|
||||||
Page,
|
|
||||||
Paginator,
|
|
||||||
ListView,
|
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
Dict[str, Union[List[str], str]],
|
Dict[str, Union[List[str], str]],
|
||||||
Dict[
|
Dict[
|
||||||
str,
|
str, Union[AuthenticationForm, LoginView, RequestSite, str]
|
||||||
Union[RequestSite, BaseForm, TemplateResponseMixin, str],
|
|
||||||
],
|
],
|
||||||
Dict[str, Union[Model, BaseForm, TemplateResponseMixin, str]],
|
Dict[str, Union[Model, BaseForm, TemplateResponseMixin, str]],
|
||||||
MagicMock,
|
MagicMock,
|
||||||
@@ -126,17 +112,15 @@ class SimpleTemplateResponse(HttpResponse):
|
|||||||
],
|
],
|
||||||
) -> Optional[
|
) -> Optional[
|
||||||
Union[
|
Union[
|
||||||
Dict[str, Optional[Union[List[Dict[str, str]], bool, ListView]]],
|
Dict[str, Any],
|
||||||
|
Dict[str, List[Dict[str, Any]]],
|
||||||
Dict[
|
Dict[
|
||||||
str,
|
str,
|
||||||
Optional[
|
Optional[
|
||||||
Union[
|
Union[
|
||||||
|
List[Dict[str, Optional[Union[datetime, Model, str]]]],
|
||||||
bool,
|
bool,
|
||||||
date,
|
ListView,
|
||||||
Page,
|
|
||||||
Paginator,
|
|
||||||
QuerySet,
|
|
||||||
MultipleObjectTemplateResponseMixin,
|
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
@@ -144,16 +128,10 @@ class SimpleTemplateResponse(HttpResponse):
|
|||||||
Dict[str, Union[Dict[str, str], DetailView]],
|
Dict[str, Union[Dict[str, str], DetailView]],
|
||||||
Dict[
|
Dict[
|
||||||
str,
|
str,
|
||||||
Union[
|
Union[List[Dict[str, str]], bool, Page, Paginator, ListView],
|
||||||
List[Dict[str, Optional[Union[datetime, Model, str]]]],
|
|
||||||
bool,
|
|
||||||
Page,
|
|
||||||
Paginator,
|
|
||||||
ListView,
|
|
||||||
],
|
|
||||||
],
|
],
|
||||||
Dict[str, Union[List[str], str]],
|
Dict[str, Union[List[str], str]],
|
||||||
Dict[str, Union[RequestSite, BaseForm, TemplateResponseMixin, str]],
|
Dict[str, Union[AuthenticationForm, LoginView, RequestSite, str]],
|
||||||
Dict[str, Union[Model, BaseForm, TemplateResponseMixin, str]],
|
Dict[str, Union[Model, BaseForm, TemplateResponseMixin, str]],
|
||||||
MagicMock,
|
MagicMock,
|
||||||
]
|
]
|
||||||
@@ -177,29 +155,29 @@ class TemplateResponse(SimpleTemplateResponse):
|
|||||||
context: django.template.context.RequestContext
|
context: django.template.context.RequestContext
|
||||||
context_data: Optional[
|
context_data: Optional[
|
||||||
Union[
|
Union[
|
||||||
|
Dict[str, Any],
|
||||||
|
Dict[str, List[Dict[str, Any]]],
|
||||||
Dict[
|
Dict[
|
||||||
str,
|
str,
|
||||||
Optional[
|
Optional[
|
||||||
Union[
|
Union[
|
||||||
List[Dict[str, str]],
|
List[
|
||||||
|
Dict[
|
||||||
|
str,
|
||||||
|
Optional[
|
||||||
|
Union[
|
||||||
|
datetime.datetime,
|
||||||
|
django.db.models.base.Model,
|
||||||
|
str,
|
||||||
|
]
|
||||||
|
],
|
||||||
|
]
|
||||||
|
],
|
||||||
bool,
|
bool,
|
||||||
django.views.generic.list.ListView,
|
django.views.generic.list.ListView,
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Optional[
|
|
||||||
Union[
|
|
||||||
bool,
|
|
||||||
datetime.date,
|
|
||||||
django.core.paginator.Page,
|
|
||||||
django.core.paginator.Paginator,
|
|
||||||
django.db.models.query.QuerySet,
|
|
||||||
django.views.generic.list.MultipleObjectTemplateResponseMixin,
|
|
||||||
]
|
|
||||||
],
|
|
||||||
],
|
|
||||||
Dict[str, Union[Callable, int]],
|
Dict[str, Union[Callable, int]],
|
||||||
Dict[
|
Dict[
|
||||||
str,
|
str,
|
||||||
@@ -208,18 +186,7 @@ class TemplateResponse(SimpleTemplateResponse):
|
|||||||
Dict[
|
Dict[
|
||||||
str,
|
str,
|
||||||
Union[
|
Union[
|
||||||
List[
|
List[Dict[str, str]],
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Optional[
|
|
||||||
Union[
|
|
||||||
datetime.datetime,
|
|
||||||
django.db.models.base.Model,
|
|
||||||
str,
|
|
||||||
]
|
|
||||||
],
|
|
||||||
]
|
|
||||||
],
|
|
||||||
bool,
|
bool,
|
||||||
django.core.paginator.Page,
|
django.core.paginator.Page,
|
||||||
django.core.paginator.Paginator,
|
django.core.paginator.Paginator,
|
||||||
@@ -230,9 +197,9 @@ class TemplateResponse(SimpleTemplateResponse):
|
|||||||
Dict[
|
Dict[
|
||||||
str,
|
str,
|
||||||
Union[
|
Union[
|
||||||
|
django.contrib.auth.forms.AuthenticationForm,
|
||||||
|
django.contrib.auth.views.LoginView,
|
||||||
django.contrib.sites.requests.RequestSite,
|
django.contrib.sites.requests.RequestSite,
|
||||||
django.forms.forms.BaseForm,
|
|
||||||
django.views.generic.base.TemplateResponseMixin,
|
|
||||||
str,
|
str,
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
@@ -268,19 +235,17 @@ class TemplateResponse(SimpleTemplateResponse):
|
|||||||
template: Union[List[str], Template, str],
|
template: Union[List[str], Template, str],
|
||||||
context: Optional[
|
context: Optional[
|
||||||
Union[
|
Union[
|
||||||
Dict[
|
Dict[str, Any],
|
||||||
str, Optional[Union[List[Dict[str, str]], bool, ListView]]
|
Dict[str, List[Dict[str, Any]]],
|
||||||
],
|
|
||||||
Dict[
|
Dict[
|
||||||
str,
|
str,
|
||||||
Optional[
|
Optional[
|
||||||
Union[
|
Union[
|
||||||
|
List[
|
||||||
|
Dict[str, Optional[Union[datetime, Model, str]]]
|
||||||
|
],
|
||||||
bool,
|
bool,
|
||||||
date,
|
ListView,
|
||||||
Page,
|
|
||||||
Paginator,
|
|
||||||
QuerySet,
|
|
||||||
MultipleObjectTemplateResponseMixin,
|
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
@@ -289,17 +254,12 @@ class TemplateResponse(SimpleTemplateResponse):
|
|||||||
Dict[
|
Dict[
|
||||||
str,
|
str,
|
||||||
Union[
|
Union[
|
||||||
List[Dict[str, Optional[Union[datetime, Model, str]]]],
|
List[Dict[str, str]], bool, Page, Paginator, ListView
|
||||||
bool,
|
|
||||||
Page,
|
|
||||||
Paginator,
|
|
||||||
ListView,
|
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
Dict[str, Union[List[str], str]],
|
Dict[str, Union[List[str], str]],
|
||||||
Dict[
|
Dict[
|
||||||
str,
|
str, Union[AuthenticationForm, LoginView, RequestSite, str]
|
||||||
Union[RequestSite, BaseForm, TemplateResponseMixin, str],
|
|
||||||
],
|
],
|
||||||
Dict[str, Union[Model, BaseForm, TemplateResponseMixin, str]],
|
Dict[str, Union[Model, BaseForm, TemplateResponseMixin, str]],
|
||||||
MagicMock,
|
MagicMock,
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ from django.utils.safestring import SafeText
|
|||||||
|
|
||||||
register: Any
|
register: Any
|
||||||
|
|
||||||
def localize(value: Union[date, float, int]) -> str: ...
|
def localize(value: Union[date, float]) -> str: ...
|
||||||
def unlocalize(value: Union[date, float, int]) -> str: ...
|
def unlocalize(value: Union[date, float]) -> str: ...
|
||||||
|
|
||||||
class LocalizeNode(Node):
|
class LocalizeNode(Node):
|
||||||
origin: django.template.base.Origin
|
origin: django.template.base.Origin
|
||||||
|
|||||||
@@ -14,7 +14,6 @@ from django.http.response import (HttpResponse, HttpResponseBase,
|
|||||||
HttpResponseRedirect)
|
HttpResponseRedirect)
|
||||||
from django.template.base import Template
|
from django.template.base import Template
|
||||||
from django.template.context import Context
|
from django.template.context import Context
|
||||||
from django.test.utils import ContextList
|
|
||||||
|
|
||||||
|
|
||||||
class RedirectCycleError(Exception):
|
class RedirectCycleError(Exception):
|
||||||
@@ -36,28 +35,7 @@ class ClientHandler(BaseHandler):
|
|||||||
def __init__(
|
def __init__(
|
||||||
self, enforce_csrf_checks: bool = ..., *args: Any, **kwargs: Any
|
self, enforce_csrf_checks: bool = ..., *args: Any, **kwargs: Any
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
def __call__(
|
def __call__(self, environ: Dict[str, Any]) -> HttpResponseBase: ...
|
||||||
self,
|
|
||||||
environ: Union[
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Optional[
|
|
||||||
Union[Tuple[int, int], BytesIO, FakePayload, int, str]
|
|
||||||
],
|
|
||||||
],
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
Dict[str, str],
|
|
||||||
Tuple[int, int],
|
|
||||||
BytesIO,
|
|
||||||
FakePayload,
|
|
||||||
int,
|
|
||||||
str,
|
|
||||||
],
|
|
||||||
],
|
|
||||||
],
|
|
||||||
) -> HttpResponseBase: ...
|
|
||||||
|
|
||||||
def encode_multipart(
|
def encode_multipart(
|
||||||
boundary: str,
|
boundary: str,
|
||||||
@@ -80,18 +58,7 @@ def encode_multipart(
|
|||||||
Dict[str, SimpleUploadedFile],
|
Dict[str, SimpleUploadedFile],
|
||||||
],
|
],
|
||||||
) -> bytes: ...
|
) -> bytes: ...
|
||||||
def encode_file(
|
def encode_file(boundary: str, key: str, file: Any) -> List[bytes]: ...
|
||||||
boundary: str,
|
|
||||||
key: str,
|
|
||||||
file: Union[
|
|
||||||
BufferedRandom,
|
|
||||||
BufferedReader,
|
|
||||||
BytesIO,
|
|
||||||
StringIO,
|
|
||||||
SimpleUploadedFile,
|
|
||||||
_TemporaryFileWrapper,
|
|
||||||
],
|
|
||||||
) -> List[bytes]: ...
|
|
||||||
|
|
||||||
class RequestFactory:
|
class RequestFactory:
|
||||||
json_encoder: Type[django.core.serializers.json.DjangoJSONEncoder] = ...
|
json_encoder: Type[django.core.serializers.json.DjangoJSONEncoder] = ...
|
||||||
|
|||||||
@@ -7,14 +7,12 @@ def normalize_whitespace(string: str) -> str: ...
|
|||||||
|
|
||||||
class Element:
|
class Element:
|
||||||
name: str = ...
|
name: str = ...
|
||||||
attributes: List[Union[Tuple[str, None], Tuple[str, str]]] = ...
|
attributes: List[Tuple[str, Optional[str]]] = ...
|
||||||
children: List[Union[django.test.html.Element, str]] = ...
|
children: List[Union[django.test.html.Element, str]] = ...
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
name: Optional[str],
|
name: Optional[str],
|
||||||
attributes: Union[
|
attributes: Union[List[Tuple[str, Optional[str]]], Tuple],
|
||||||
List[Union[Tuple[str, None], Tuple[str, str]]], Tuple
|
|
||||||
],
|
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
def append(self, element: Union[Element, str]) -> None: ...
|
def append(self, element: Union[Element, str]) -> None: ...
|
||||||
def finalize(self) -> None: ...
|
def finalize(self) -> None: ...
|
||||||
@@ -45,10 +43,10 @@ class Parser(HTMLParser):
|
|||||||
@property
|
@property
|
||||||
def current(self) -> Element: ...
|
def current(self) -> Element: ...
|
||||||
def handle_startendtag(
|
def handle_startendtag(
|
||||||
self, tag: str, attrs: List[Union[Tuple[str, None], Tuple[str, str]]]
|
self, tag: str, attrs: List[Tuple[str, Optional[str]]]
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
def handle_starttag(
|
def handle_starttag(
|
||||||
self, tag: str, attrs: List[Union[Tuple[str, None], Tuple[str, str]]]
|
self, tag: str, attrs: List[Tuple[str, Optional[str]]]
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
def handle_endtag(self, tag: str) -> None: ...
|
def handle_endtag(self, tag: str) -> None: ...
|
||||||
def handle_data(self, data: str) -> None: ...
|
def handle_data(self, data: str) -> None: ...
|
||||||
|
|||||||
@@ -14,20 +14,10 @@ class DebugSQLTextTestResult(unittest.TextTestResult):
|
|||||||
buffer: bool
|
buffer: bool
|
||||||
descriptions: bool
|
descriptions: bool
|
||||||
dots: bool
|
dots: bool
|
||||||
errors: List[
|
errors: List[Tuple[unittest.case.TestCase, str, str]]
|
||||||
Union[
|
|
||||||
Tuple[django.test.testcases.TestCase, str, str],
|
|
||||||
Tuple[unittest.case._SubTest, str, str],
|
|
||||||
]
|
|
||||||
]
|
|
||||||
expectedFailures: List[Any]
|
expectedFailures: List[Any]
|
||||||
failfast: bool
|
failfast: bool
|
||||||
failures: List[
|
failures: List[Tuple[unittest.case.TestCase, str, str]]
|
||||||
Union[
|
|
||||||
Tuple[django.test.testcases.TestCase, str, str],
|
|
||||||
Tuple[unittest.case._SubTest, str, str],
|
|
||||||
]
|
|
||||||
]
|
|
||||||
shouldStop: bool
|
shouldStop: bool
|
||||||
showAll: bool
|
showAll: bool
|
||||||
skipped: List[Any]
|
skipped: List[Any]
|
||||||
|
|||||||
@@ -1,12 +1,10 @@
|
|||||||
import threading
|
import threading
|
||||||
import unittest
|
import unittest
|
||||||
from contextlib import _GeneratorContextManager
|
from contextlib import _GeneratorContextManager
|
||||||
from datetime import date, time, timedelta
|
from datetime import date
|
||||||
from decimal import Decimal
|
|
||||||
from typing import (Any, Callable, Dict, Iterator, List, Optional, Set, Tuple,
|
from typing import (Any, Callable, Dict, Iterator, List, Optional, Set, Tuple,
|
||||||
Type, Union)
|
Type, Union)
|
||||||
from unittest.runner import TextTestResult
|
from unittest.runner import TextTestResult
|
||||||
from uuid import UUID
|
|
||||||
|
|
||||||
from django.contrib.staticfiles.handlers import StaticFilesHandler
|
from django.contrib.staticfiles.handlers import StaticFilesHandler
|
||||||
from django.core.handlers.wsgi import WSGIHandler
|
from django.core.handlers.wsgi import WSGIHandler
|
||||||
@@ -19,8 +17,8 @@ from django.forms.fields import EmailField
|
|||||||
from django.http.response import HttpResponse, HttpResponseBase
|
from django.http.response import HttpResponse, HttpResponseBase
|
||||||
from django.template.context import Context
|
from django.template.context import Context
|
||||||
from django.test.html import Element
|
from django.test.html import Element
|
||||||
from django.test.utils import (Approximate, CaptureQueriesContext,
|
from django.test.utils import (CaptureQueriesContext, modify_settings,
|
||||||
modify_settings, override_settings)
|
override_settings)
|
||||||
from django.utils.deprecation import RemovedInDjango30Warning
|
from django.utils.deprecation import RemovedInDjango30Warning
|
||||||
from django.utils.safestring import SafeText
|
from django.utils.safestring import SafeText
|
||||||
|
|
||||||
@@ -209,45 +207,12 @@ class TransactionTestCase(SimpleTestCase):
|
|||||||
qs: Union[Iterator[Any], List[Model], QuerySet, RawQuerySet],
|
qs: Union[Iterator[Any], List[Model], QuerySet, RawQuerySet],
|
||||||
values: Union[
|
values: Union[
|
||||||
List[Optional[str]],
|
List[Optional[str]],
|
||||||
|
List[Tuple[Any, Any]],
|
||||||
List[Tuple[Model, Model]],
|
List[Tuple[Model, Model]],
|
||||||
List[Tuple[Model, int, int]],
|
List[Tuple[Model, int, int]],
|
||||||
List[Tuple[str, Type[Model], int]],
|
List[Tuple[str, Type[Model], int]],
|
||||||
List[
|
|
||||||
Union[
|
|
||||||
Tuple[
|
|
||||||
Optional[
|
|
||||||
Union[
|
|
||||||
bytes,
|
|
||||||
date,
|
|
||||||
time,
|
|
||||||
timedelta,
|
|
||||||
Decimal,
|
|
||||||
Approximate,
|
|
||||||
float,
|
|
||||||
int,
|
|
||||||
str,
|
|
||||||
UUID,
|
|
||||||
]
|
|
||||||
],
|
|
||||||
Optional[
|
|
||||||
Union[
|
|
||||||
bytes,
|
|
||||||
date,
|
|
||||||
time,
|
|
||||||
timedelta,
|
|
||||||
Decimal,
|
|
||||||
Approximate,
|
|
||||||
float,
|
|
||||||
int,
|
|
||||||
str,
|
|
||||||
UUID,
|
|
||||||
]
|
|
||||||
],
|
|
||||||
],
|
|
||||||
int,
|
|
||||||
]
|
|
||||||
],
|
|
||||||
List[date],
|
List[date],
|
||||||
|
List[int],
|
||||||
Set[str],
|
Set[str],
|
||||||
QuerySet,
|
QuerySet,
|
||||||
],
|
],
|
||||||
|
|||||||
+49
-102
@@ -7,21 +7,14 @@ from typing import (Any, Callable, Dict, Iterator, List, Optional, Set, Tuple,
|
|||||||
|
|
||||||
from django.apps.registry import Apps
|
from django.apps.registry import Apps
|
||||||
from django.conf import LazySettings
|
from django.conf import LazySettings
|
||||||
from django.contrib.admin.helpers import AdminForm
|
|
||||||
from django.contrib.admin.views.main import ChangeList
|
|
||||||
from django.contrib.messages.storage.fallback import FallbackStorage
|
|
||||||
from django.db import DefaultConnectionProxy
|
from django.db import DefaultConnectionProxy
|
||||||
from django.db.backends.base.base import BaseDatabaseWrapper
|
from django.db.backends.base.base import BaseDatabaseWrapper
|
||||||
from django.db.backends.sqlite3.base import DatabaseWrapper
|
from django.db.backends.sqlite3.base import DatabaseWrapper
|
||||||
from django.db.models.base import Model
|
|
||||||
from django.forms.forms import BaseForm
|
|
||||||
from django.forms.widgets import Media
|
|
||||||
from django.template.base import Template
|
from django.template.base import Template
|
||||||
from django.template.context import Context
|
from django.template.context import Context
|
||||||
from django.test.runner import DiscoverRunner
|
from django.test.runner import DiscoverRunner
|
||||||
from django.test.testcases import SimpleTestCase
|
from django.test.testcases import SimpleTestCase
|
||||||
from django.utils.safestring import SafeText
|
from django.utils.safestring import SafeText
|
||||||
from django.views.generic.detail import SingleObjectTemplateResponseMixin
|
|
||||||
|
|
||||||
|
|
||||||
class Approximate:
|
class Approximate:
|
||||||
@@ -33,23 +26,7 @@ class Approximate:
|
|||||||
def __eq__(self, other: Union[Decimal, float]) -> bool: ...
|
def __eq__(self, other: Union[Decimal, float]) -> bool: ...
|
||||||
|
|
||||||
class ContextList(list):
|
class ContextList(list):
|
||||||
def __getitem__(
|
def __getitem__(self, key: Union[int, str]) -> Any: ...
|
||||||
self, key: Union[int, str]
|
|
||||||
) -> Optional[
|
|
||||||
Union[
|
|
||||||
List[Union[List[str], str]],
|
|
||||||
bool,
|
|
||||||
AdminForm,
|
|
||||||
ChangeList,
|
|
||||||
FallbackStorage,
|
|
||||||
Model,
|
|
||||||
BaseForm,
|
|
||||||
Media,
|
|
||||||
Context,
|
|
||||||
SingleObjectTemplateResponseMixin,
|
|
||||||
str,
|
|
||||||
]
|
|
||||||
]: ...
|
|
||||||
def get(self, key: str, default: Optional[str] = ...) -> str: ...
|
def get(self, key: str, default: Optional[str] = ...) -> str: ...
|
||||||
def __contains__(self, key: str) -> bool: ...
|
def __contains__(self, key: str) -> bool: ...
|
||||||
def keys(self) -> Set[str]: ...
|
def keys(self) -> Set[str]: ...
|
||||||
@@ -60,7 +37,7 @@ def setup_test_environment(debug: Optional[bool] = ...) -> None: ...
|
|||||||
def teardown_test_environment() -> None: ...
|
def teardown_test_environment() -> None: ...
|
||||||
def get_runner(
|
def get_runner(
|
||||||
settings: LazySettings, test_runner_class: Optional[str] = ...
|
settings: LazySettings, test_runner_class: Optional[str] = ...
|
||||||
) -> Type[Union[Any, DiscoverRunner]]: ...
|
) -> Type[DiscoverRunner]: ...
|
||||||
|
|
||||||
class TestContextDecorator:
|
class TestContextDecorator:
|
||||||
attr_name: Any = ...
|
attr_name: Any = ...
|
||||||
@@ -95,35 +72,45 @@ class override_settings(TestContextDecorator):
|
|||||||
Dict[
|
Dict[
|
||||||
str,
|
str,
|
||||||
Union[
|
Union[
|
||||||
Dict[str, Optional[str]],
|
Dict[
|
||||||
Dict[str, Union[Callable, Dict[str, int], str]],
|
str,
|
||||||
Dict[str, Union[Dict[str, int], int, str]],
|
Union[
|
||||||
|
Callable, Dict[str, Union[Dict[str, bool], bool]]
|
||||||
|
],
|
||||||
|
],
|
||||||
|
Dict[
|
||||||
|
str, Union[Dict[str, Union[Dict[str, bool], bool]], int]
|
||||||
|
],
|
||||||
|
Dict[
|
||||||
|
str, Union[Dict[str, Union[Dict[str, bool], bool]], str]
|
||||||
|
],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
Dict[
|
Dict[
|
||||||
str,
|
str,
|
||||||
List[
|
Dict[
|
||||||
Dict[
|
str,
|
||||||
str, Union[Dict[str, List[Tuple[str, Dict[str, str]]]], str]
|
Union[
|
||||||
]
|
Dict[str, Union[Callable, Dict[str, int], str]],
|
||||||
],
|
Dict[str, Union[Dict[str, int], int, str]],
|
||||||
],
|
],
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
List[
|
|
||||||
Union[
|
|
||||||
Dict[str, Union[Dict[Any, Any], bool, str]],
|
|
||||||
Dict[str, Union[Dict[str, bool], bool, str]],
|
|
||||||
]
|
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
|
Dict[str, List[Dict[str, Union[Dict[Any, Any], bool, str]]]],
|
||||||
Dict[
|
Dict[
|
||||||
str,
|
str,
|
||||||
List[
|
List[
|
||||||
Union[
|
Union[
|
||||||
|
Dict[
|
||||||
|
str,
|
||||||
|
Union[
|
||||||
|
Dict[str, List[Tuple[str, Dict[str, str]]]],
|
||||||
|
bool,
|
||||||
|
str,
|
||||||
|
],
|
||||||
|
],
|
||||||
Dict[str, Union[Dict[str, List[str]], str]],
|
Dict[str, Union[Dict[str, List[str]], str]],
|
||||||
Dict[str, Union[bool, str]],
|
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
@@ -131,16 +118,7 @@ class override_settings(TestContextDecorator):
|
|||||||
str,
|
str,
|
||||||
List[
|
List[
|
||||||
Union[
|
Union[
|
||||||
Dict[str, Union[Dict[str, bool], str]],
|
Dict[str, Union[Dict[str, int], bool, str]],
|
||||||
Dict[str, Union[Dict[str, int], str]],
|
|
||||||
]
|
|
||||||
],
|
|
||||||
],
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
List[
|
|
||||||
Union[
|
|
||||||
Dict[str, Union[Dict[str, int], str]],
|
|
||||||
Dict[str, Union[Dict[str, str], str]],
|
Dict[str, Union[Dict[str, str], str]],
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
@@ -152,69 +130,25 @@ class override_settings(TestContextDecorator):
|
|||||||
Dict[str, Type[Any]],
|
Dict[str, Type[Any]],
|
||||||
Dict[str, Union[Callable, bool]],
|
Dict[str, Union[Callable, bool]],
|
||||||
Dict[str, Union[Dict[int, None], bool]],
|
Dict[str, Union[Dict[int, None], bool]],
|
||||||
Dict[str, Union[Dict[str, None], List[str]]],
|
|
||||||
Dict[str, Union[Dict[str, Optional[str]], str]],
|
|
||||||
Dict[
|
Dict[
|
||||||
str,
|
str,
|
||||||
Union[
|
Union[
|
||||||
Dict[
|
Dict[str, Dict[str, Optional[str]]], List[Tuple[str, str]], str
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
Dict[Any, Any],
|
|
||||||
Dict[str, Callable],
|
|
||||||
Dict[str, int],
|
|
||||||
Dict[str, str],
|
|
||||||
],
|
|
||||||
],
|
|
||||||
List[
|
|
||||||
Dict[str, Union[Dict[str, List[str]], List[str], bool, str]]
|
|
||||||
],
|
|
||||||
List[Union[Tuple[str, str], str]],
|
|
||||||
int,
|
|
||||||
str,
|
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
|
Dict[str, Union[Dict[str, Optional[str]], List[str]]],
|
||||||
Dict[
|
Dict[
|
||||||
str,
|
str,
|
||||||
Union[
|
Union[
|
||||||
Dict[
|
Dict[
|
||||||
str,
|
str,
|
||||||
Union[
|
Union[
|
||||||
Dict[str, Dict[str, Union[List[str], bool, str]]],
|
Dict[str, Dict[str, Union[List[str], bool, str]]], int
|
||||||
Dict[str, Dict[str, str]],
|
|
||||||
int,
|
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
str,
|
str,
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[
|
|
||||||
Callable,
|
|
||||||
Dict[str, Union[Dict[str, bool], bool]],
|
|
||||||
],
|
|
||||||
],
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[Dict[str, Union[Dict[str, bool], bool]], int],
|
|
||||||
],
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Union[Dict[str, Union[Dict[str, bool], bool]], str],
|
|
||||||
],
|
|
||||||
str,
|
|
||||||
],
|
|
||||||
],
|
|
||||||
List[str],
|
|
||||||
],
|
|
||||||
],
|
|
||||||
Dict[
|
Dict[
|
||||||
str,
|
str,
|
||||||
Union[
|
Union[
|
||||||
@@ -224,13 +158,15 @@ class override_settings(TestContextDecorator):
|
|||||||
Dict[str, Union[Callable, str]],
|
Dict[str, Union[Callable, str]],
|
||||||
Dict[str, Union[Dict[str, int], str]],
|
Dict[str, Union[Dict[str, int], str]],
|
||||||
Dict[str, Union[int, str]],
|
Dict[str, Union[int, str]],
|
||||||
Dict[str, str],
|
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
bool,
|
bool,
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
Dict[str, Union[Dict[str, Union[Dict[str, str], str]], bool]],
|
Dict[
|
||||||
|
str,
|
||||||
|
Union[Dict[str, Union[Dict[str, str], str]], List[str], int, str],
|
||||||
|
],
|
||||||
Dict[
|
Dict[
|
||||||
str,
|
str,
|
||||||
Union[
|
Union[
|
||||||
@@ -240,6 +176,17 @@ class override_settings(TestContextDecorator):
|
|||||||
List[str],
|
List[str],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
|
Dict[
|
||||||
|
str,
|
||||||
|
Union[
|
||||||
|
List[
|
||||||
|
Dict[str, Union[Dict[str, List[str]], List[str], bool, str]]
|
||||||
|
],
|
||||||
|
List[Union[Tuple[str, str], str]],
|
||||||
|
int,
|
||||||
|
str,
|
||||||
|
],
|
||||||
|
],
|
||||||
Dict[
|
Dict[
|
||||||
str,
|
str,
|
||||||
Union[
|
Union[
|
||||||
@@ -271,7 +218,7 @@ class modify_settings(override_settings):
|
|||||||
kwarg_name: None
|
kwarg_name: None
|
||||||
wrapped: Union[django.conf.Settings, django.conf.UserSettingsHolder]
|
wrapped: Union[django.conf.Settings, django.conf.UserSettingsHolder]
|
||||||
operations: List[
|
operations: List[
|
||||||
Union[Tuple[str, Dict[str, List[str]]], Tuple[str, Dict[str, str]]]
|
Tuple[str, Union[Dict[str, List[str]], Dict[str, str]]]
|
||||||
] = ...
|
] = ...
|
||||||
def __init__(self, *args: Any, **kwargs: Any) -> None: ...
|
def __init__(self, *args: Any, **kwargs: Any) -> None: ...
|
||||||
def save_options(self, test_func: Type[SimpleTestCase]) -> None: ...
|
def save_options(self, test_func: Type[SimpleTestCase]) -> None: ...
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ def get_conditional_response(
|
|||||||
response: Optional[HttpResponse] = ...,
|
response: Optional[HttpResponse] = ...,
|
||||||
) -> Optional[HttpResponse]: ...
|
) -> Optional[HttpResponse]: ...
|
||||||
def patch_response_headers(
|
def patch_response_headers(
|
||||||
response: HttpResponseBase, cache_timeout: Union[float, int] = ...
|
response: HttpResponseBase, cache_timeout: float = ...
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
def add_never_cache_headers(response: HttpResponseBase) -> None: ...
|
def add_never_cache_headers(response: HttpResponseBase) -> None: ...
|
||||||
def patch_vary_headers(
|
def patch_vary_headers(
|
||||||
@@ -29,12 +29,14 @@ def get_cache_key(
|
|||||||
request: WSGIRequest,
|
request: WSGIRequest,
|
||||||
key_prefix: Optional[str] = ...,
|
key_prefix: Optional[str] = ...,
|
||||||
method: str = ...,
|
method: str = ...,
|
||||||
cache: Optional[Union[DefaultCacheProxy, BaseCache]] = ...,
|
cache: Optional[Union[DefaultCacheProxy, backends.base.BaseCache]] = ...,
|
||||||
) -> Optional[str]: ...
|
) -> Optional[str]: ...
|
||||||
def learn_cache_key(
|
def learn_cache_key(
|
||||||
request: WSGIRequest,
|
request: WSGIRequest,
|
||||||
response: HttpResponse,
|
response: HttpResponse,
|
||||||
cache_timeout: Optional[Union[float, int]] = ...,
|
cache_timeout: Optional[float] = ...,
|
||||||
key_prefix: Optional[str] = ...,
|
key_prefix: Optional[str] = ...,
|
||||||
cache: Optional[Union[DefaultCacheProxy, LocMemCache]] = ...,
|
cache: Optional[
|
||||||
|
Union[DefaultCacheProxy, backends.locmem.LocMemCache]
|
||||||
|
] = ...,
|
||||||
) -> str: ...
|
) -> str: ...
|
||||||
|
|||||||
@@ -5,14 +5,13 @@ from typing import (Any, Callable, Dict, Iterator, List, Optional, Tuple, Type,
|
|||||||
from unittest.case import TestCase
|
from unittest.case import TestCase
|
||||||
from uuid import UUID
|
from uuid import UUID
|
||||||
|
|
||||||
from django.contrib.sitemaps import Sitemap
|
from django.contrib.sitemaps import GenericSitemap, Sitemap
|
||||||
from django.core.files.uploadedfile import InMemoryUploadedFile, UploadedFile
|
from django.core.files.uploadedfile import InMemoryUploadedFile, UploadedFile
|
||||||
from django.db.models.base import Model
|
from django.db.models.base import Model
|
||||||
from django.db.models.expressions import Combinable
|
from django.db.models.expressions import Combinable
|
||||||
from django.test.testcases import SerializeMixin
|
from django.test.testcases import SerializeMixin
|
||||||
from django.test.utils import LoggingCaptureMixin
|
from django.test.utils import LoggingCaptureMixin
|
||||||
from django.urls.converters import (IntConverter, PathConverter, SlugConverter,
|
from django.urls.converters import IntConverter, StringConverter, UUIDConverter
|
||||||
StringConverter, UUIDConverter)
|
|
||||||
|
|
||||||
|
|
||||||
class OrderedSet:
|
class OrderedSet:
|
||||||
@@ -23,8 +22,9 @@ class OrderedSet:
|
|||||||
Union[
|
Union[
|
||||||
List[Optional[int]],
|
List[Optional[int]],
|
||||||
List[Tuple[str, str]],
|
List[Tuple[str, str]],
|
||||||
List[Union[Combinable, str]],
|
|
||||||
List[datetime],
|
List[datetime],
|
||||||
|
List[Combinable],
|
||||||
|
List[str],
|
||||||
List[UUID],
|
List[UUID],
|
||||||
OrderedDict,
|
OrderedDict,
|
||||||
]
|
]
|
||||||
@@ -76,37 +76,27 @@ class MultiValueDict(dict):
|
|||||||
self, key: Union[Callable, str], default_list: None = ...
|
self, key: Union[Callable, str], default_list: None = ...
|
||||||
) -> Union[
|
) -> Union[
|
||||||
List[
|
List[
|
||||||
Union[
|
Tuple[
|
||||||
Tuple[
|
List[Tuple[str, List[str]]],
|
||||||
List[Tuple[str, List[Any]]],
|
str,
|
||||||
str,
|
Dict[str, Dict[str, GenericSitemap]],
|
||||||
Dict[str, Dict[str, Type[Sitemap]]],
|
Dict[str, Any],
|
||||||
Dict[Any, Any],
|
]
|
||||||
],
|
],
|
||||||
Tuple[
|
List[
|
||||||
List[Tuple[str, List[str]]],
|
Tuple[
|
||||||
str,
|
List[Tuple[str, List[str]]],
|
||||||
Dict[str, int],
|
str,
|
||||||
Union[
|
Dict[str, Union[Dict[str, Type[Sitemap]], str]],
|
||||||
Dict[Any, Any],
|
Union[Dict[str, StringConverter], Dict[str, UUIDConverter]],
|
||||||
Dict[str, IntConverter],
|
]
|
||||||
Dict[str, PathConverter],
|
],
|
||||||
Dict[str, SlugConverter],
|
List[
|
||||||
Dict[str, StringConverter],
|
Tuple[
|
||||||
Dict[str, UUIDConverter],
|
List[Tuple[str, List[str]]],
|
||||||
],
|
str,
|
||||||
],
|
Dict[str, int],
|
||||||
Tuple[
|
Union[Dict[str, IntConverter], Dict[str, StringConverter]],
|
||||||
List[Union[Tuple[str, List[Any]], Tuple[str, List[str]]]],
|
|
||||||
str,
|
|
||||||
Dict[Any, Any],
|
|
||||||
Union[
|
|
||||||
Dict[Any, Any],
|
|
||||||
Dict[str, Any],
|
|
||||||
Dict[str, IntConverter],
|
|
||||||
Dict[str, StringConverter],
|
|
||||||
],
|
|
||||||
],
|
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
List[UploadedFile],
|
List[UploadedFile],
|
||||||
@@ -116,23 +106,19 @@ class MultiValueDict(dict):
|
|||||||
self,
|
self,
|
||||||
key: Union[Callable, str],
|
key: Union[Callable, str],
|
||||||
value: Union[
|
value: Union[
|
||||||
Tuple[
|
|
||||||
List[Tuple[str, List[Any]]],
|
|
||||||
str,
|
|
||||||
Dict[str, Dict[str, Sitemap]],
|
|
||||||
Dict[Any, Any],
|
|
||||||
],
|
|
||||||
Tuple[
|
Tuple[
|
||||||
List[Tuple[str, List[str]]],
|
List[Tuple[str, List[str]]],
|
||||||
str,
|
str,
|
||||||
Dict[str, Union[int, str]],
|
Union[
|
||||||
Dict[str, Union[IntConverter, StringConverter]],
|
Dict[Any, Any],
|
||||||
],
|
Dict[str, Any],
|
||||||
Tuple[
|
Dict[str, Union[IntConverter, StringConverter]],
|
||||||
List[Union[Tuple[str, List[Any]], Tuple[str, List[str]]]],
|
],
|
||||||
str,
|
Union[
|
||||||
Dict[str, Union[Dict[str, Type[Sitemap]], str]],
|
Dict[str, Any],
|
||||||
Dict[str, UUIDConverter],
|
Dict[str, Union[IntConverter, StringConverter]],
|
||||||
|
Dict[str, UUIDConverter],
|
||||||
|
],
|
||||||
],
|
],
|
||||||
UploadedFile,
|
UploadedFile,
|
||||||
str,
|
str,
|
||||||
|
|||||||
@@ -36,16 +36,13 @@ def decorator_from_middleware_with_args(
|
|||||||
) -> Callable: ...
|
) -> Callable: ...
|
||||||
def decorator_from_middleware(
|
def decorator_from_middleware(
|
||||||
middleware_class: Type[
|
middleware_class: Type[
|
||||||
Union[
|
Union[XViewMiddleware, CsrfViewMiddleware, ConditionalGetMiddleware]
|
||||||
Any, XViewMiddleware, CsrfViewMiddleware, ConditionalGetMiddleware
|
|
||||||
]
|
|
||||||
]
|
]
|
||||||
) -> Callable: ...
|
) -> Callable: ...
|
||||||
def available_attrs(fn: Any): ...
|
def available_attrs(fn: Any): ...
|
||||||
def make_middleware_decorator(
|
def make_middleware_decorator(
|
||||||
middleware_class: Type[
|
middleware_class: Type[
|
||||||
Union[
|
Union[
|
||||||
Any,
|
|
||||||
XViewMiddleware,
|
XViewMiddleware,
|
||||||
CacheMiddleware,
|
CacheMiddleware,
|
||||||
CsrfViewMiddleware,
|
CsrfViewMiddleware,
|
||||||
|
|||||||
@@ -1,10 +1,7 @@
|
|||||||
from datetime import date, time, timedelta
|
from datetime import date
|
||||||
from decimal import Decimal
|
from typing import Any, Optional, Union
|
||||||
from typing import Any, Dict, Optional, Union
|
|
||||||
from uuid import UUID
|
|
||||||
|
|
||||||
from django.db.models.base import Model
|
from django.db.models.base import Model
|
||||||
from django.db.models.fields.files import FieldFile
|
|
||||||
|
|
||||||
|
|
||||||
class DjangoUnicodeDecodeError(UnicodeDecodeError):
|
class DjangoUnicodeDecodeError(UnicodeDecodeError):
|
||||||
@@ -19,22 +16,7 @@ def smart_text(
|
|||||||
strings_only: bool = ...,
|
strings_only: bool = ...,
|
||||||
errors: str = ...,
|
errors: str = ...,
|
||||||
) -> str: ...
|
) -> str: ...
|
||||||
def is_protected_type(
|
def is_protected_type(obj: Any) -> bool: ...
|
||||||
obj: Optional[
|
|
||||||
Union[
|
|
||||||
date,
|
|
||||||
time,
|
|
||||||
timedelta,
|
|
||||||
Decimal,
|
|
||||||
FieldFile,
|
|
||||||
float,
|
|
||||||
int,
|
|
||||||
memoryview,
|
|
||||||
str,
|
|
||||||
UUID,
|
|
||||||
]
|
|
||||||
]
|
|
||||||
) -> bool: ...
|
|
||||||
def force_text(
|
def force_text(
|
||||||
s: Optional[Union[bytes, Model, int, str]],
|
s: Optional[Union[bytes, Model, int, str]],
|
||||||
encoding: str = ...,
|
encoding: str = ...,
|
||||||
@@ -48,12 +30,7 @@ def smart_bytes(
|
|||||||
errors: str = ...,
|
errors: str = ...,
|
||||||
) -> bytes: ...
|
) -> bytes: ...
|
||||||
def force_bytes(
|
def force_bytes(
|
||||||
s: Union[
|
s: Any, encoding: str = ..., strings_only: bool = ..., errors: str = ...
|
||||||
Dict[str, str], ValueError, bytes, date, int, memoryview, str, UUID
|
|
||||||
],
|
|
||||||
encoding: str = ...,
|
|
||||||
strings_only: bool = ...,
|
|
||||||
errors: str = ...,
|
|
||||||
) -> Union[bytes, date]: ...
|
) -> Union[bytes, date]: ...
|
||||||
|
|
||||||
smart_str = smart_text
|
smart_str = smart_text
|
||||||
|
|||||||
@@ -55,10 +55,10 @@ class SyndicationFeed:
|
|||||||
def item_attributes(
|
def item_attributes(
|
||||||
self,
|
self,
|
||||||
item: Union[
|
item: Union[
|
||||||
|
Dict[str, Any],
|
||||||
Dict[
|
Dict[
|
||||||
str, Optional[Union[List[Enclosure], List[str], datetime, str]]
|
str, Optional[Union[List[Enclosure], List[str], datetime, str]]
|
||||||
],
|
],
|
||||||
Dict[str, Optional[Union[List[str], Tuple, bool, datetime, str]]],
|
|
||||||
],
|
],
|
||||||
) -> Dict[Any, Any]: ...
|
) -> Dict[Any, Any]: ...
|
||||||
def add_item_elements(self, handler: Any, item: Any) -> None: ...
|
def add_item_elements(self, handler: Any, item: Any) -> None: ...
|
||||||
@@ -101,6 +101,7 @@ class Rss201rev2Feed(RssFeed):
|
|||||||
Dict[str, Optional[Union[Tuple, str]]],
|
Dict[str, Optional[Union[Tuple, str]]],
|
||||||
]
|
]
|
||||||
items: Union[
|
items: Union[
|
||||||
|
List[Dict[str, Any]],
|
||||||
List[
|
List[
|
||||||
Dict[
|
Dict[
|
||||||
str,
|
str,
|
||||||
@@ -114,21 +115,15 @@ class Rss201rev2Feed(RssFeed):
|
|||||||
],
|
],
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
List[
|
|
||||||
Dict[
|
|
||||||
str,
|
|
||||||
Optional[Union[List[str], Tuple, bool, datetime.datetime, str]],
|
|
||||||
]
|
|
||||||
],
|
|
||||||
]
|
]
|
||||||
def add_item_elements(
|
def add_item_elements(
|
||||||
self,
|
self,
|
||||||
handler: SimplerXMLGenerator,
|
handler: SimplerXMLGenerator,
|
||||||
item: Union[
|
item: Union[
|
||||||
|
Dict[str, Any],
|
||||||
Dict[
|
Dict[
|
||||||
str, Optional[Union[List[Enclosure], List[str], datetime, str]]
|
str, Optional[Union[List[Enclosure], List[str], datetime, str]]
|
||||||
],
|
],
|
||||||
Dict[str, Optional[Union[List[str], Tuple, bool, datetime, str]]],
|
|
||||||
],
|
],
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
|
|
||||||
|
|||||||
@@ -1,18 +1,6 @@
|
|||||||
from datetime import date, time
|
from datetime import date, time
|
||||||
from decimal import Decimal
|
from decimal import Decimal
|
||||||
from typing import Any, Dict, Iterator, List, Optional, Tuple, Union
|
from typing import Any, Iterator, List, Optional, Union
|
||||||
|
|
||||||
from django.contrib.auth.models import AnonymousUser
|
|
||||||
from django.contrib.messages.storage.base import Message
|
|
||||||
from django.core.exceptions import FieldDoesNotExist
|
|
||||||
from django.db.models.base import Model
|
|
||||||
from django.db.models.fields.files import FieldFile
|
|
||||||
from django.db.models.query import QuerySet
|
|
||||||
from django.forms.boundfield import BoundField, BoundWidget
|
|
||||||
from django.forms.forms import BaseForm
|
|
||||||
from django.forms.utils import ErrorDict
|
|
||||||
from django.forms.widgets import Media
|
|
||||||
from django.urls.resolvers import CheckURLMixin, LocalePrefixPattern
|
|
||||||
|
|
||||||
ISO_INPUT_FORMATS: Any
|
ISO_INPUT_FORMATS: Any
|
||||||
FORMAT_SETTINGS: Any
|
FORMAT_SETTINGS: Any
|
||||||
@@ -41,70 +29,14 @@ def time_format(
|
|||||||
use_l10n: None = ...,
|
use_l10n: None = ...,
|
||||||
) -> str: ...
|
) -> str: ...
|
||||||
def number_format(
|
def number_format(
|
||||||
value: Union[Decimal, float, int, str],
|
value: Union[Decimal, float, str],
|
||||||
decimal_pos: Optional[int] = ...,
|
decimal_pos: Optional[int] = ...,
|
||||||
use_l10n: Optional[bool] = ...,
|
use_l10n: Optional[bool] = ...,
|
||||||
force_grouping: bool = ...,
|
force_grouping: bool = ...,
|
||||||
) -> str: ...
|
) -> str: ...
|
||||||
def localize(
|
def localize(value: Any, use_l10n: Optional[bool] = ...) -> Any: ...
|
||||||
value: Optional[
|
|
||||||
Union[
|
|
||||||
AttributeError,
|
|
||||||
Dict[str, str],
|
|
||||||
KeyError,
|
|
||||||
List[ErrorDict],
|
|
||||||
List[int],
|
|
||||||
List[str],
|
|
||||||
Tuple[int, int, int, int],
|
|
||||||
TypeError,
|
|
||||||
date,
|
|
||||||
Decimal,
|
|
||||||
AnonymousUser,
|
|
||||||
Message,
|
|
||||||
FieldDoesNotExist,
|
|
||||||
Model,
|
|
||||||
FieldFile,
|
|
||||||
QuerySet,
|
|
||||||
BoundField,
|
|
||||||
BoundWidget,
|
|
||||||
BaseForm,
|
|
||||||
Media,
|
|
||||||
CheckURLMixin,
|
|
||||||
LocalePrefixPattern,
|
|
||||||
float,
|
|
||||||
int,
|
|
||||||
str,
|
|
||||||
]
|
|
||||||
],
|
|
||||||
use_l10n: Optional[bool] = ...,
|
|
||||||
) -> Optional[
|
|
||||||
Union[
|
|
||||||
AttributeError,
|
|
||||||
Dict[str, str],
|
|
||||||
KeyError,
|
|
||||||
List[ErrorDict],
|
|
||||||
List[int],
|
|
||||||
List[str],
|
|
||||||
Tuple[int, int, int, int],
|
|
||||||
TypeError,
|
|
||||||
AnonymousUser,
|
|
||||||
Message,
|
|
||||||
FieldDoesNotExist,
|
|
||||||
Model,
|
|
||||||
FieldFile,
|
|
||||||
QuerySet,
|
|
||||||
BoundField,
|
|
||||||
BoundWidget,
|
|
||||||
BaseForm,
|
|
||||||
Media,
|
|
||||||
CheckURLMixin,
|
|
||||||
LocalePrefixPattern,
|
|
||||||
str,
|
|
||||||
]
|
|
||||||
]: ...
|
|
||||||
def localize_input(
|
def localize_input(
|
||||||
value: Optional[Union[date, time, Decimal, float, int, str]],
|
value: Any, default: Optional[str] = ...
|
||||||
default: Optional[str] = ...,
|
|
||||||
) -> Optional[str]: ...
|
) -> Optional[str]: ...
|
||||||
def sanitize_separators(
|
def sanitize_separators(
|
||||||
value: Union[Decimal, int, str]
|
value: Union[Decimal, int, str]
|
||||||
|
|||||||
@@ -1,63 +1,6 @@
|
|||||||
from datetime import date, time, timedelta
|
|
||||||
from decimal import Context
|
|
||||||
from typing import Any, Callable, Dict, List, Optional, Tuple, Type, Union
|
from typing import Any, Callable, Dict, List, Optional, Tuple, Type, Union
|
||||||
from uuid import UUID
|
|
||||||
|
|
||||||
from django.contrib.sessions.backends.db import SessionStore
|
|
||||||
from django.contrib.staticfiles.management.commands.collectstatic import \
|
|
||||||
Command
|
|
||||||
from django.core.exceptions import ObjectDoesNotExist
|
|
||||||
from django.core.files.base import File
|
|
||||||
from django.core.files.storage import FileSystemStorage
|
|
||||||
from django.core.management.base import BaseCommand
|
|
||||||
from django.core.management.commands.loaddata import Command
|
|
||||||
from django.core.management.commands.makemessages import BuildFile, Command
|
|
||||||
from django.core.paginator import Paginator
|
|
||||||
from django.db.backends.sqlite3.base import DatabaseWrapper
|
|
||||||
from django.db.backends.sqlite3.features import DatabaseFeatures
|
|
||||||
from django.db.migrations.operations.base import Operation
|
|
||||||
from django.db.migrations.operations.fields import (AddField, AlterField,
|
|
||||||
RemoveField, RenameField)
|
|
||||||
from django.db.migrations.operations.models import (AlterIndexTogether,
|
|
||||||
AlterModelTable,
|
|
||||||
AlterOrderWithRespectTo,
|
|
||||||
AlterUniqueTogether,
|
|
||||||
CreateModel, DeleteModel,
|
|
||||||
RenameModel)
|
|
||||||
from django.db.migrations.state import ModelState, ProjectState, StateApps
|
|
||||||
from django.db.models.base import Model
|
from django.db.models.base import Model
|
||||||
from django.db.models.expressions import (BaseExpression, Col, Expression,
|
|
||||||
OrderBy)
|
|
||||||
from django.db.models.fields import Field
|
|
||||||
from django.db.models.fields.files import FieldFile
|
|
||||||
from django.db.models.fields.mixins import FieldCacheMixin
|
|
||||||
from django.db.models.fields.related import RelatedField
|
|
||||||
from django.db.models.fields.related_descriptors import (ForwardManyToOneDescriptor,
|
|
||||||
ReverseOneToOneDescriptor)
|
|
||||||
from django.db.models.fields.reverse_related import ForeignObjectRel
|
|
||||||
from django.db.models.lookups import Lookup
|
|
||||||
from django.db.models.manager import Manager
|
|
||||||
from django.db.models.options import Options
|
|
||||||
from django.db.models.query import QuerySet, RawQuerySet
|
|
||||||
from django.db.models.sql.query import Query
|
|
||||||
from django.db.models.sql.where import WhereNode
|
|
||||||
from django.db.utils import ConnectionHandler, ConnectionRouter
|
|
||||||
from django.forms.boundfield import BoundField, BoundWidget
|
|
||||||
from django.forms.forms import Form
|
|
||||||
from django.forms.renderers import DjangoTemplates, EngineMixin, Jinja2
|
|
||||||
from django.http.request import HttpRequest
|
|
||||||
from django.template.backends.base import BaseEngine
|
|
||||||
from django.template.backends.dummy import TemplateStrings
|
|
||||||
from django.template.backends.jinja2 import Jinja2
|
|
||||||
from django.template.engine import Engine
|
|
||||||
from django.template.loaders.base import Loader
|
|
||||||
from django.template.utils import EngineHandler
|
|
||||||
from django.urls.resolvers import URLPattern, URLResolver
|
|
||||||
from django.views.generic.base import TemplateResponseMixin
|
|
||||||
from django.views.generic.dates import (ArchiveIndexView, DateDetailView,
|
|
||||||
DayArchiveView, MonthArchiveView,
|
|
||||||
TodayArchiveView, WeekArchiveView,
|
|
||||||
YearArchiveView)
|
|
||||||
|
|
||||||
|
|
||||||
def curry(_curried_func: Any, *args: Any, **kwargs: Any): ...
|
def curry(_curried_func: Any, *args: Any, **kwargs: Any): ...
|
||||||
@@ -67,139 +10,7 @@ class cached_property:
|
|||||||
__doc__: Any = ...
|
__doc__: Any = ...
|
||||||
name: str = ...
|
name: str = ...
|
||||||
def __init__(self, func: Callable, name: Optional[str] = ...) -> None: ...
|
def __init__(self, func: Callable, name: Optional[str] = ...) -> None: ...
|
||||||
def __get__(
|
def __get__(self, instance: Any, cls: Type[Any] = ...) -> Any: ...
|
||||||
self,
|
|
||||||
instance: Optional[
|
|
||||||
Union[
|
|
||||||
SessionStore,
|
|
||||||
File,
|
|
||||||
FileSystemStorage,
|
|
||||||
BaseCommand,
|
|
||||||
BuildFile,
|
|
||||||
Paginator,
|
|
||||||
DatabaseWrapper,
|
|
||||||
DatabaseFeatures,
|
|
||||||
Operation,
|
|
||||||
ModelState,
|
|
||||||
ProjectState,
|
|
||||||
BaseExpression,
|
|
||||||
Field,
|
|
||||||
ForwardManyToOneDescriptor,
|
|
||||||
ReverseOneToOneDescriptor,
|
|
||||||
ForeignObjectRel,
|
|
||||||
Lookup,
|
|
||||||
Options,
|
|
||||||
RawQuerySet,
|
|
||||||
Query,
|
|
||||||
WhereNode,
|
|
||||||
ConnectionHandler,
|
|
||||||
ConnectionRouter,
|
|
||||||
BoundField,
|
|
||||||
Form,
|
|
||||||
EngineMixin,
|
|
||||||
HttpRequest,
|
|
||||||
BaseEngine,
|
|
||||||
Engine,
|
|
||||||
EngineHandler,
|
|
||||||
URLPattern,
|
|
||||||
URLResolver,
|
|
||||||
TemplateResponseMixin,
|
|
||||||
]
|
|
||||||
],
|
|
||||||
cls: Type[
|
|
||||||
Union[
|
|
||||||
SessionStore,
|
|
||||||
Command,
|
|
||||||
File,
|
|
||||||
FileSystemStorage,
|
|
||||||
Command,
|
|
||||||
BuildFile,
|
|
||||||
Command,
|
|
||||||
Paginator,
|
|
||||||
DatabaseWrapper,
|
|
||||||
DatabaseFeatures,
|
|
||||||
AddField,
|
|
||||||
AlterField,
|
|
||||||
RemoveField,
|
|
||||||
RenameField,
|
|
||||||
AlterIndexTogether,
|
|
||||||
AlterModelTable,
|
|
||||||
AlterOrderWithRespectTo,
|
|
||||||
AlterUniqueTogether,
|
|
||||||
CreateModel,
|
|
||||||
DeleteModel,
|
|
||||||
RenameModel,
|
|
||||||
ModelState,
|
|
||||||
ProjectState,
|
|
||||||
Model,
|
|
||||||
Expression,
|
|
||||||
OrderBy,
|
|
||||||
Field,
|
|
||||||
ForwardManyToOneDescriptor,
|
|
||||||
ReverseOneToOneDescriptor,
|
|
||||||
ForeignObjectRel,
|
|
||||||
Lookup,
|
|
||||||
Options,
|
|
||||||
RawQuerySet,
|
|
||||||
Query,
|
|
||||||
WhereNode,
|
|
||||||
ConnectionHandler,
|
|
||||||
ConnectionRouter,
|
|
||||||
BoundField,
|
|
||||||
Form,
|
|
||||||
DjangoTemplates,
|
|
||||||
Jinja2,
|
|
||||||
HttpRequest,
|
|
||||||
TemplateStrings,
|
|
||||||
Jinja2,
|
|
||||||
Engine,
|
|
||||||
EngineHandler,
|
|
||||||
URLPattern,
|
|
||||||
URLResolver,
|
|
||||||
ArchiveIndexView,
|
|
||||||
DateDetailView,
|
|
||||||
DayArchiveView,
|
|
||||||
MonthArchiveView,
|
|
||||||
TodayArchiveView,
|
|
||||||
WeekArchiveView,
|
|
||||||
YearArchiveView,
|
|
||||||
]
|
|
||||||
] = ...,
|
|
||||||
) -> Optional[
|
|
||||||
Union[
|
|
||||||
Callable,
|
|
||||||
Dict[str, Dict[str, Union[Dict[str, bool], str]]],
|
|
||||||
Dict[str, Dict[str, Union[Dict[str, str], str]]],
|
|
||||||
Dict[str, Union[Field, mixins.FieldCacheMixin, str]],
|
|
||||||
Dict[str, Manager],
|
|
||||||
List[Tuple[str, Callable]],
|
|
||||||
List[Union[Callable, related.RelatedField]],
|
|
||||||
List[Union[BoundWidget, Loader]],
|
|
||||||
List[Union[URLPattern, URLResolver]],
|
|
||||||
List[Union[int, str]],
|
|
||||||
List[Model],
|
|
||||||
Tuple,
|
|
||||||
Type[Union[Any, ObjectDoesNotExist, Model, str]],
|
|
||||||
date,
|
|
||||||
time,
|
|
||||||
timedelta,
|
|
||||||
Context,
|
|
||||||
StateApps,
|
|
||||||
Model,
|
|
||||||
Col,
|
|
||||||
Field,
|
|
||||||
files.FieldFile,
|
|
||||||
Manager,
|
|
||||||
QuerySet,
|
|
||||||
BaseEngine,
|
|
||||||
cached_property,
|
|
||||||
float,
|
|
||||||
frozenset,
|
|
||||||
int,
|
|
||||||
str,
|
|
||||||
UUID,
|
|
||||||
]
|
|
||||||
]: ...
|
|
||||||
|
|
||||||
class Promise: ...
|
class Promise: ...
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ from typing import Any, Dict, Iterator, List, Optional, Tuple, Union
|
|||||||
|
|
||||||
from django.db.models.base import Model
|
from django.db.models.base import Model
|
||||||
from django.db.models.fields.files import FieldFile
|
from django.db.models.fields.files import FieldFile
|
||||||
from django.forms.utils import ErrorList
|
|
||||||
from django.utils.safestring import SafeText
|
from django.utils.safestring import SafeText
|
||||||
|
|
||||||
TRAILING_PUNCTUATION_CHARS: str
|
TRAILING_PUNCTUATION_CHARS: str
|
||||||
@@ -19,9 +18,7 @@ def escapejs(value: str) -> SafeText: ...
|
|||||||
def json_script(
|
def json_script(
|
||||||
value: Union[Dict[str, str], str], element_id: str
|
value: Union[Dict[str, str], str], element_id: str
|
||||||
) -> SafeText: ...
|
) -> SafeText: ...
|
||||||
def conditional_escape(
|
def conditional_escape(text: Any) -> str: ...
|
||||||
text: Optional[Union[Model, FieldFile, ErrorList, int, str]]
|
|
||||||
) -> str: ...
|
|
||||||
def format_html(format_string: str, *args: Any, **kwargs: Any) -> SafeText: ...
|
def format_html(format_string: str, *args: Any, **kwargs: Any) -> SafeText: ...
|
||||||
def format_html_join(
|
def format_html_join(
|
||||||
sep: str,
|
sep: str,
|
||||||
|
|||||||
@@ -24,21 +24,21 @@ def urlencode(
|
|||||||
Dict[str, bytearray],
|
Dict[str, bytearray],
|
||||||
Dict[str, bytes],
|
Dict[str, bytes],
|
||||||
Dict[str, date],
|
Dict[str, date],
|
||||||
List[Union[Tuple[str, int], Tuple[str, str]]],
|
List[Tuple[str, Union[int, str]]],
|
||||||
Tuple[Tuple[str, int], Tuple[str, int], Tuple[str, int]],
|
Tuple[Tuple[str, int], Tuple[str, int], Tuple[str, int]],
|
||||||
str,
|
str,
|
||||||
],
|
],
|
||||||
doseq: bool = ...,
|
doseq: bool = ...,
|
||||||
) -> str: ...
|
) -> str: ...
|
||||||
def cookie_date(epoch_seconds: float = ...) -> str: ...
|
def cookie_date(epoch_seconds: float = ...) -> str: ...
|
||||||
def http_date(epoch_seconds: Union[float, int] = ...) -> str: ...
|
def http_date(epoch_seconds: float = ...) -> str: ...
|
||||||
def parse_http_date(date: str) -> int: ...
|
def parse_http_date(date: str) -> int: ...
|
||||||
def parse_http_date_safe(date: str) -> Optional[int]: ...
|
def parse_http_date_safe(date: str) -> Optional[int]: ...
|
||||||
def base36_to_int(
|
def base36_to_int(
|
||||||
s: Union[Dict[int, int], Tuple[int, int, int], float, int, str]
|
s: Union[Dict[int, int], Tuple[int, int, int], float, str]
|
||||||
) -> int: ...
|
) -> int: ...
|
||||||
def int_to_base36(
|
def int_to_base36(
|
||||||
i: Union[Dict[int, int], Tuple[int, int, int], float, int, str]
|
i: Union[Dict[int, int], Tuple[int, int, int], float, str]
|
||||||
) -> str: ...
|
) -> str: ...
|
||||||
def urlsafe_base64_encode(s: bytes) -> bytes: ...
|
def urlsafe_base64_encode(s: bytes) -> bytes: ...
|
||||||
def urlsafe_base64_decode(s: Union[bytes, str]) -> bytes: ...
|
def urlsafe_base64_decode(s: Union[bytes, str]) -> bytes: ...
|
||||||
|
|||||||
@@ -1,10 +1,8 @@
|
|||||||
from typing import Any, Callable, List, Optional, Tuple, Union
|
from typing import Any, Callable, List, Optional, Tuple
|
||||||
|
|
||||||
|
|
||||||
def get_func_args(func: Callable) -> List[str]: ...
|
def get_func_args(func: Callable) -> List[str]: ...
|
||||||
def get_func_full_args(
|
def get_func_full_args(func: Callable) -> List[Tuple[str]]: ...
|
||||||
func: Callable
|
|
||||||
) -> List[Union[Tuple[str, int], Tuple[str, str], Tuple[str]]]: ...
|
|
||||||
def func_accepts_kwargs(func: Callable) -> bool: ...
|
def func_accepts_kwargs(func: Callable) -> bool: ...
|
||||||
def func_accepts_var_args(func: Callable) -> bool: ...
|
def func_accepts_var_args(func: Callable) -> bool: ...
|
||||||
def func_has_no_args(func: Any): ...
|
def func_has_no_args(func: Any): ...
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ def is_iterable(
|
|||||||
]
|
]
|
||||||
],
|
],
|
||||||
List[Tuple[int, int, int]],
|
List[Tuple[int, int, int]],
|
||||||
List[Union[List[Union[List[List[str]], str]], CheckMessage]],
|
List[CheckMessage],
|
||||||
List[int],
|
List[int],
|
||||||
List[str],
|
List[str],
|
||||||
Tuple[
|
Tuple[
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user