mirror of
https://github.com/davidhalter/django-stubs.git
synced 2026-04-07 08:24:04 +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
|
||||
|
||||
ENVIRONMENT_VARIABLE: str
|
||||
|
||||
class LazySettings(LazyObject):
|
||||
def __getattr__(
|
||||
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 __getattr__(self, name: str) -> Any: ...
|
||||
def __setattr__(self, name: str, value: Any) -> None: ...
|
||||
def __delattr__(self, name: str) -> None: ...
|
||||
def configure(self, default_settings: Any = ..., **options: Any) -> Any: ...
|
||||
@@ -124,136 +27,8 @@ class UserSettingsHolder:
|
||||
def __init__(
|
||||
self, default_settings: Union[Settings, UserSettingsHolder]
|
||||
) -> None: ...
|
||||
def __getattr__(
|
||||
self, name: str
|
||||
) -> 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 __getattr__(self, name: str) -> Any: ...
|
||||
def __setattr__(self, name: str, value: Any) -> None: ...
|
||||
def __delattr__(self, name: str) -> None: ...
|
||||
def __dir__(self) -> List[str]: ...
|
||||
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.mixins import FieldCacheMixin
|
||||
from django.db.models.fields.related import RelatedField
|
||||
from django.db.models.fields.reverse_related import ForeignObjectRel
|
||||
from django.db.models.query import QuerySet
|
||||
|
||||
|
||||
@@ -47,7 +48,7 @@ class FieldListFilter(ListFilter):
|
||||
title: Any = ...
|
||||
def __init__(
|
||||
self,
|
||||
field: Union[Field, mixins.FieldCacheMixin],
|
||||
field: Union[Field, ForeignObjectRel],
|
||||
request: WSGIRequest,
|
||||
params: Dict[str, str],
|
||||
model: Type[Model],
|
||||
@@ -76,7 +77,7 @@ class FieldListFilter(ListFilter):
|
||||
@classmethod
|
||||
def create(
|
||||
cls,
|
||||
field: Union[Field, mixins.FieldCacheMixin],
|
||||
field: Union[Field, ForeignObjectRel],
|
||||
request: WSGIRequest,
|
||||
params: Dict[str, str],
|
||||
model: Type[Model],
|
||||
|
||||
@@ -23,13 +23,7 @@ class LogEntryManager(models.Manager):
|
||||
action_flag: int,
|
||||
change_message: Union[
|
||||
Dict[str, Dict[str, List[str]]],
|
||||
List[
|
||||
Union[
|
||||
Dict[str, Dict[str, List[str]]],
|
||||
Dict[str, Dict[str, Union[List[str], str]]],
|
||||
Dict[str, Dict[str, str]],
|
||||
]
|
||||
],
|
||||
List[Dict[str, Dict[str, Union[List[str], str]]]],
|
||||
str,
|
||||
] = ...,
|
||||
) -> LogEntry: ...
|
||||
|
||||
@@ -100,14 +100,7 @@ class BaseModelAdmin:
|
||||
],
|
||||
Tuple[Tuple[None, Dict[str, Tuple[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]]],
|
||||
],
|
||||
],
|
||||
Tuple[str, Dict[str, Tuple[str]]], Tuple[str, Dict[str, Tuple[str]]]
|
||||
],
|
||||
]: ...
|
||||
def get_ordering(self, request: WSGIRequest) -> Union[List[str], Tuple]: ...
|
||||
@@ -137,16 +130,7 @@ class BaseModelAdmin:
|
||||
|
||||
class ModelAdmin(BaseModelAdmin):
|
||||
formfield_overrides: Dict[
|
||||
Type[
|
||||
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,
|
||||
]
|
||||
],
|
||||
Type[Any],
|
||||
Dict[
|
||||
str,
|
||||
Type[
|
||||
@@ -234,8 +218,7 @@ class ModelAdmin(BaseModelAdmin):
|
||||
request: WSGIRequest,
|
||||
object: Model,
|
||||
message: Union[
|
||||
Dict[str, Dict[Any, Any]],
|
||||
List[Union[Dict[str, Dict[Any, Any]], Dict[str, Dict[str, str]]]],
|
||||
Dict[str, Dict[Any, Any]], List[Dict[str, Dict[str, str]]]
|
||||
],
|
||||
) -> LogEntry: ...
|
||||
def log_change(
|
||||
@@ -244,13 +227,7 @@ class ModelAdmin(BaseModelAdmin):
|
||||
object: Model,
|
||||
message: Union[
|
||||
Dict[str, Dict[str, List[str]]],
|
||||
List[
|
||||
Union[
|
||||
Dict[str, Dict[str, List[str]]],
|
||||
Dict[str, Dict[str, Union[List[str], str]]],
|
||||
Dict[str, Dict[str, str]],
|
||||
]
|
||||
],
|
||||
List[Dict[str, Dict[str, Union[List[str], str]]]],
|
||||
],
|
||||
) -> LogEntry: ...
|
||||
def log_deletion(
|
||||
|
||||
@@ -40,14 +40,7 @@ def result_list(
|
||||
) -> Dict[
|
||||
str,
|
||||
Union[
|
||||
List[
|
||||
Union[
|
||||
Dict[str, Optional[Union[int, str]]],
|
||||
Dict[str, Union[bool, SafeText]],
|
||||
Dict[str, Union[bool, str]],
|
||||
Dict[str, Union[int, str]],
|
||||
]
|
||||
],
|
||||
List[Dict[str, Optional[Union[int, str]]]],
|
||||
List[ResultList],
|
||||
List[BoundField],
|
||||
ChangeList,
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
from datetime import date, datetime
|
||||
from decimal import Decimal
|
||||
from typing import Any, Callable, Dict, List, Optional, Set, Tuple, Type, Union
|
||||
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.deletion import Collector
|
||||
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.reverse_related import (ForeignObjectRel,
|
||||
ManyToOneRel)
|
||||
from django.db.models.fields.reverse_related import ManyToOneRel, OneToOneRel
|
||||
from django.db.models.options import Options
|
||||
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[
|
||||
None,
|
||||
Union[
|
||||
Dict[str, Tuple[Tuple[str, str]]],
|
||||
Dict[str, Tuple[str, str, List[str]]],
|
||||
Dict[str, Tuple[str, str, Tuple[str, str]]],
|
||||
Dict[str, Union[Tuple[str, str, str], Tuple[str]]],
|
||||
Union[
|
||||
Tuple[Dict[str, Tuple[str]], Dict[str, Tuple[str]]],
|
||||
Tuple[
|
||||
None,
|
||||
Union[
|
||||
Dict[str, Tuple[Tuple[str, 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]]: ...
|
||||
def get_deleted_objects(
|
||||
@@ -112,12 +101,9 @@ def model_ngettext(
|
||||
def lookup_field(
|
||||
name: Union[Callable, str], obj: Model, model_admin: BaseModelAdmin = ...
|
||||
) -> Union[
|
||||
Tuple[None, Callable, Optional[Union[Callable, date, int, str]]],
|
||||
Tuple[
|
||||
Optional[Union[date, Model, FieldFile, float, int, str]],
|
||||
Optional[Union[date, Model, FieldFile, float, int, str]],
|
||||
Optional[Union[date, Model, FieldFile, float, int, str]],
|
||||
],
|
||||
Tuple[None, Callable, Optional[Callable]],
|
||||
Tuple[None, Union[date, Model, int, str], Union[date, Model, int, str]],
|
||||
Tuple[Field, None, Any],
|
||||
]: ...
|
||||
def label_for_field(
|
||||
name: Union[Callable, str],
|
||||
@@ -125,35 +111,32 @@ def label_for_field(
|
||||
model_admin: Optional[BaseModelAdmin] = ...,
|
||||
return_attr: bool = ...,
|
||||
) -> Union[
|
||||
Tuple[Callable, Callable],
|
||||
Tuple[str, Optional[Union[Type[str], GenericForeignKey]]],
|
||||
Tuple[
|
||||
Optional[Union[Callable, GenericForeignKey]],
|
||||
Optional[Union[Callable, GenericForeignKey]],
|
||||
],
|
||||
Tuple[str, Type[str]],
|
||||
str,
|
||||
]: ...
|
||||
def help_text_for_field(name: str, model: Type[Model]) -> str: ...
|
||||
def display_for_field(
|
||||
value: Optional[Union[date, Decimal, Model, FieldFile, float, int, str]],
|
||||
field: Union[Field, mixins.FieldCacheMixin],
|
||||
empty_value_display: str,
|
||||
value: Any, field: Union[Field, OneToOneRel], empty_value_display: str
|
||||
) -> str: ...
|
||||
def display_for_value(
|
||||
value: Optional[
|
||||
Union[Callable, List[Union[int, str]], date, Model, FieldFile, int, str]
|
||||
],
|
||||
empty_value_display: str,
|
||||
boolean: bool = ...,
|
||||
value: Any, empty_value_display: str, boolean: bool = ...
|
||||
) -> str: ...
|
||||
|
||||
class NotRelationField(Exception): ...
|
||||
|
||||
def get_model_from_relation(
|
||||
field: Union[Field, ForeignObjectRel]
|
||||
field: Union[Field, mixins.FieldCacheMixin]
|
||||
) -> Type[Model]: ...
|
||||
def reverse_field_path(
|
||||
model: Type[Model], path: str
|
||||
) -> Tuple[Type[Model], str]: ...
|
||||
def get_fields_from_path(
|
||||
model: Type[Model], path: str
|
||||
) -> List[Union[Field, ForeignObjectRel]]: ...
|
||||
) -> List[Union[Field, mixins.FieldCacheMixin]]: ...
|
||||
def construct_change_message(
|
||||
form: AdminPasswordChangeForm, formsets: None, add: bool
|
||||
) -> List[Dict[str, Dict[str, List[str]]]]: ...
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
from collections import OrderedDict
|
||||
from datetime import datetime
|
||||
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.core.handlers.wsgi import WSGIRequest
|
||||
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
|
||||
|
||||
ALL_VAR: str
|
||||
@@ -64,16 +64,7 @@ class ChangeList:
|
||||
def get_filters_params(self, params: None = ...) -> Dict[str, str]: ...
|
||||
def get_filters(
|
||||
self, request: WSGIRequest
|
||||
) -> Union[
|
||||
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],
|
||||
]: ...
|
||||
) -> Tuple[List[ListFilter], bool, bool, bool]: ...
|
||||
def get_query_string(
|
||||
self,
|
||||
new_params: Optional[
|
||||
@@ -95,7 +86,7 @@ class ChangeList:
|
||||
) -> Optional[Union[CombinedExpression, str]]: ...
|
||||
def get_ordering(
|
||||
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_queryset(self, request: WSGIRequest) -> QuerySet: ...
|
||||
def apply_select_related(self, qs: QuerySet) -> QuerySet: ...
|
||||
|
||||
@@ -1,19 +1,14 @@
|
||||
from collections import OrderedDict
|
||||
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 django import forms
|
||||
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.query_utils import Q
|
||||
from django.forms.fields import (BooleanField, CharField, Field, FileField,
|
||||
IntegerField, SplitDateTimeField, URLField)
|
||||
from django.forms.models import ModelChoiceField, ModelMultipleChoiceField
|
||||
from django.forms.widgets import (CheckboxInput, ChoiceWidget, DateInput,
|
||||
Media, Select, TimeInput, Widget)
|
||||
from django.forms.fields import Field
|
||||
from django.forms.widgets import ChoiceWidget, Media, Widget
|
||||
from django.http.request import QueryDict
|
||||
from django.utils.datastructures import MultiValueDict
|
||||
|
||||
@@ -35,24 +30,29 @@ class FilteredSelectMultiple(forms.SelectMultiple):
|
||||
name: str,
|
||||
value: Union[List[Any], str],
|
||||
attrs: Optional[Dict[str, str]],
|
||||
) -> Dict[
|
||||
str,
|
||||
) -> Union[
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
Dict[str, Union[int, str]],
|
||||
List[
|
||||
Tuple[
|
||||
None,
|
||||
List[Dict[str, Union[Dict[Any, Any], int, str]]],
|
||||
int,
|
||||
]
|
||||
],
|
||||
List[str],
|
||||
bool,
|
||||
Dict[
|
||||
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):
|
||||
@@ -291,62 +291,8 @@ class RelatedFieldWidgetWrapper(forms.Widget):
|
||||
) -> None: ...
|
||||
def __deepcopy__(
|
||||
self,
|
||||
memo: Union[
|
||||
Dict[
|
||||
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,
|
||||
],
|
||||
],
|
||||
memo: Dict[
|
||||
int, Union[List[Union[Field, Widget]], OrderedDict, Field, Widget]
|
||||
],
|
||||
) -> RelatedFieldWidgetWrapper: ...
|
||||
@property
|
||||
@@ -432,18 +378,7 @@ class AutocompleteMixin:
|
||||
name: str,
|
||||
value: List[str],
|
||||
attr: Dict[str, Union[bool, str]] = ...,
|
||||
) -> List[
|
||||
Tuple[
|
||||
None,
|
||||
List[
|
||||
Union[
|
||||
Dict[str, Union[Dict[Any, Any], bool, str]],
|
||||
Dict[str, Union[Dict[str, bool], Set[str], int, str]],
|
||||
]
|
||||
],
|
||||
int,
|
||||
]
|
||||
]: ...
|
||||
) -> List[Tuple[None, int, int]]: ...
|
||||
@property
|
||||
def media(self) -> Media: ...
|
||||
|
||||
|
||||
@@ -14,16 +14,7 @@ sensitive_post_parameters_m: Any
|
||||
class GroupAdmin(admin.ModelAdmin):
|
||||
admin_site: django.contrib.admin.sites.AdminSite
|
||||
formfield_overrides: Dict[
|
||||
Type[
|
||||
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,
|
||||
]
|
||||
],
|
||||
Type[Any],
|
||||
Dict[
|
||||
str,
|
||||
Type[
|
||||
@@ -49,16 +40,7 @@ class GroupAdmin(admin.ModelAdmin):
|
||||
class UserAdmin(admin.ModelAdmin):
|
||||
admin_site: django.contrib.admin.sites.AdminSite
|
||||
formfield_overrides: Dict[
|
||||
Type[
|
||||
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,
|
||||
]
|
||||
],
|
||||
Type[Any],
|
||||
Dict[
|
||||
str,
|
||||
Type[
|
||||
|
||||
@@ -11,9 +11,7 @@ def get_default_password_validators() -> Union[
|
||||
List[NumericPasswordValidator],
|
||||
]: ...
|
||||
def get_password_validators(
|
||||
validator_config: List[
|
||||
Union[Dict[str, Union[Dict[str, int], str]], Dict[str, str]]
|
||||
]
|
||||
validator_config: List[Dict[str, Union[Dict[str, int], str]]]
|
||||
) -> Union[
|
||||
List[Union[CommonPasswordValidator, MinimumLengthValidator]],
|
||||
List[Union[MinimumLengthValidator, UserAttributeSimilarityValidator]],
|
||||
@@ -48,7 +46,7 @@ class UserAttributeSimilarityValidator:
|
||||
def __init__(
|
||||
self,
|
||||
user_attributes: Union[List[str], Tuple[str, str, str, str]] = ...,
|
||||
max_similarity: Union[float, int] = ...,
|
||||
max_similarity: float = ...,
|
||||
) -> None: ...
|
||||
def validate(self, password: str, user: Optional[User] = ...) -> None: ...
|
||||
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.response import HttpResponse, HttpResponseRedirect
|
||||
from django.template.response import TemplateResponse
|
||||
from django.utils.datastructures import MultiValueDict
|
||||
from django.views.generic.base import TemplateView
|
||||
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_kwargs(
|
||||
self
|
||||
) -> Dict[
|
||||
str,
|
||||
Optional[
|
||||
Union[Dict[Any, Any], Dict[str, str], HttpRequest, MultiValueDict]
|
||||
],
|
||||
]: ...
|
||||
) -> Dict[str, Optional[Union[Dict[str, str], HttpRequest]]]: ...
|
||||
def form_valid(self, form: AuthenticationForm) -> HttpResponseRedirect: ...
|
||||
def get_context_data(
|
||||
self, **kwargs: Any
|
||||
@@ -111,9 +105,7 @@ class PasswordResetConfirmView(PasswordContextMixin, FormView):
|
||||
def get_user(self, uidb64: str) -> Optional[AbstractBaseUser]: ...
|
||||
def get_form_kwargs(
|
||||
self
|
||||
) -> Dict[
|
||||
str, Optional[Union[Dict[Any, Any], AbstractBaseUser, MultiValueDict]]
|
||||
]: ...
|
||||
) -> Dict[str, Optional[Union[Dict[Any, Any], AbstractBaseUser]]]: ...
|
||||
def form_valid(self, form: SetPasswordForm) -> HttpResponseRedirect: ...
|
||||
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.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.sites.migrations.0001_initial import Migration
|
||||
from django.contrib.sites.migrations.0002_alter_domain_unique import Migration
|
||||
from django.db import migrations
|
||||
from django.db.backends.sqlite3.schema import DatabaseSchemaEditor
|
||||
from django.db.migrations.migration import Migration
|
||||
from django.db.migrations.state import StateApps
|
||||
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(
|
||||
app_config: AppConfig,
|
||||
verbosity: int = ...,
|
||||
interactive: bool = ...,
|
||||
using: str = ...,
|
||||
apps: Apps = ...,
|
||||
**kwargs
|
||||
**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 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 intcomma(
|
||||
value: Optional[Union[Decimal, float, int, str]], use_l10n: bool = ...
|
||||
value: Optional[Union[Decimal, float, str]], use_l10n: bool = ...
|
||||
) -> str: ...
|
||||
|
||||
intword_converters: Any
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
from typing import Any, Dict, List, Optional, Tuple, Union
|
||||
|
||||
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.fields import Field
|
||||
from django.db.models.lookups import Exact, In
|
||||
@@ -16,7 +17,10 @@ class ArrayField(CheckFieldDefaultMixin, Field):
|
||||
default_validators: Any = ...
|
||||
from_db_value: Any = ...
|
||||
def __init__(
|
||||
self, base_field: Field, size: None = ..., **kwargs: Any
|
||||
self,
|
||||
base_field: Union[CheckFieldDefaultMixin, Field],
|
||||
size: None = ...,
|
||||
**kwargs: Any
|
||||
) -> None: ...
|
||||
@property
|
||||
def model(self): ...
|
||||
|
||||
@@ -26,7 +26,7 @@ class Command(BaseCommand):
|
||||
ignore_patterns: Any = ...
|
||||
post_process: Any = ...
|
||||
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 log(self, msg: str, level: int = ...) -> None: ...
|
||||
def is_local_storage(self) -> bool: ...
|
||||
|
||||
51
django-stubs/core/cache/backends/db.pyi
vendored
51
django-stubs/core/cache/backends/db.pyi
vendored
@@ -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.db.models.base import Model
|
||||
from django.db.models.query import QuerySet
|
||||
from django.http.response import HttpResponse
|
||||
|
||||
|
||||
class Options:
|
||||
@@ -46,53 +43,11 @@ class DatabaseCache(BaseDatabaseCache):
|
||||
key: str,
|
||||
default: Optional[Union[int, str]] = ...,
|
||||
version: Optional[int] = ...,
|
||||
) -> Optional[
|
||||
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,
|
||||
]
|
||||
]: ...
|
||||
) -> Any: ...
|
||||
def set(
|
||||
self,
|
||||
key: str,
|
||||
value: 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,
|
||||
],
|
||||
value: Any,
|
||||
timeout: Any = ...,
|
||||
version: Optional[int] = ...,
|
||||
) -> None: ...
|
||||
|
||||
19
django-stubs/core/cache/backends/dummy.pyi
vendored
19
django-stubs/core/cache/backends/dummy.pyi
vendored
@@ -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
|
||||
|
||||
@@ -21,22 +21,7 @@ class DummyCache(BaseCache):
|
||||
def set(
|
||||
self,
|
||||
key: str,
|
||||
value: Union[
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
Callable,
|
||||
Dict[str, int],
|
||||
List[int],
|
||||
Tuple[int, int, int, int],
|
||||
Type[Any],
|
||||
int,
|
||||
str,
|
||||
],
|
||||
],
|
||||
int,
|
||||
str,
|
||||
],
|
||||
value: Union[Dict[str, Any], int, str],
|
||||
timeout: Any = ...,
|
||||
version: Optional[str] = ...,
|
||||
) -> None: ...
|
||||
|
||||
27
django-stubs/core/cache/backends/filebased.pyi
vendored
27
django-stubs/core/cache/backends/filebased.pyi
vendored
@@ -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.db.models.base import Model
|
||||
from django.db.models.query import QuerySet
|
||||
from django.http.response import HttpResponse
|
||||
|
||||
|
||||
class FileBasedCache(BaseCache):
|
||||
@@ -38,27 +35,7 @@ class FileBasedCache(BaseCache):
|
||||
def set(
|
||||
self,
|
||||
key: str,
|
||||
value: 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,
|
||||
],
|
||||
value: Any,
|
||||
timeout: Any = ...,
|
||||
version: Optional[int] = ...,
|
||||
) -> None: ...
|
||||
|
||||
50
django-stubs/core/cache/backends/locmem.pyi
vendored
50
django-stubs/core/cache/backends/locmem.pyi
vendored
@@ -1,10 +1,7 @@
|
||||
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.db.models.base import Model
|
||||
from django.db.models.query import QuerySet
|
||||
from django.http.response import HttpResponse
|
||||
|
||||
|
||||
class LocMemCache(BaseCache):
|
||||
@@ -37,52 +34,11 @@ class LocMemCache(BaseCache):
|
||||
key: Union[int, str],
|
||||
default: Optional[Union[int, str]] = ...,
|
||||
version: Optional[int] = ...,
|
||||
) -> Union[
|
||||
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,
|
||||
]: ...
|
||||
) -> Any: ...
|
||||
def set(
|
||||
self,
|
||||
key: Union[int, str],
|
||||
value: Union[
|
||||
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,
|
||||
],
|
||||
value: Any,
|
||||
timeout: Any = ...,
|
||||
version: Optional[int] = ...,
|
||||
) -> None: ...
|
||||
|
||||
@@ -1,10 +1,4 @@
|
||||
from typing import Any, Callable, Optional, Type, 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
|
||||
from typing import Any, Optional, Union
|
||||
|
||||
DEBUG: int
|
||||
INFO: int
|
||||
@@ -23,16 +17,7 @@ class CheckMessage:
|
||||
level: int,
|
||||
msg: str,
|
||||
hint: Optional[str] = ...,
|
||||
obj: Optional[
|
||||
Union[
|
||||
Callable,
|
||||
Type[Union[ModelAdmin, Model]],
|
||||
GenericForeignKey,
|
||||
Field,
|
||||
Manager,
|
||||
str,
|
||||
]
|
||||
] = ...,
|
||||
obj: Any = ...,
|
||||
id: Optional[str] = ...,
|
||||
) -> None: ...
|
||||
def __eq__(self, other: Union[CheckMessage, str]) -> bool: ...
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
from typing import Any, Callable, List, Optional, Set, Union
|
||||
|
||||
from django.contrib.admin.apps import SimpleAdminConfig
|
||||
from django.contrib.auth.apps import AuthConfig
|
||||
from django.apps.config import AppConfig
|
||||
from django.core.checks.messages import CheckMessage
|
||||
|
||||
|
||||
@@ -28,7 +27,7 @@ class CheckRegistry:
|
||||
) -> Callable: ...
|
||||
def run_checks(
|
||||
self,
|
||||
app_configs: Optional[List[Union[SimpleAdminConfig, AuthConfig]]] = ...,
|
||||
app_configs: Optional[List[AppConfig]] = ...,
|
||||
tags: Optional[List[str]] = ...,
|
||||
include_deployment_checks: bool = ...,
|
||||
) -> 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 django.core.files.utils import FileProxyMixin
|
||||
@@ -12,23 +8,7 @@ class File(FileProxyMixin):
|
||||
file: _io.BufferedReader = ...
|
||||
name: str = ...
|
||||
mode: str = ...
|
||||
def __init__(
|
||||
self,
|
||||
file: Optional[
|
||||
Union[
|
||||
BufferedRandom,
|
||||
BufferedReader,
|
||||
BufferedWriter,
|
||||
BytesIO,
|
||||
StringIO,
|
||||
TextIOWrapper,
|
||||
HTTPResponse,
|
||||
SpooledTemporaryFile,
|
||||
_TemporaryFileWrapper,
|
||||
]
|
||||
],
|
||||
name: Optional[str] = ...,
|
||||
) -> None: ...
|
||||
def __init__(self, file: Any, name: Optional[str] = ...) -> None: ...
|
||||
def __bool__(self) -> bool: ...
|
||||
def __len__(self) -> int: ...
|
||||
def size(self) -> int: ...
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
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,
|
||||
TemporaryUploadedFile)
|
||||
from django.core.handlers.wsgi import WSGIRequest
|
||||
from django.test.client import FakePayload
|
||||
|
||||
|
||||
class UploadFileException(Exception): ...
|
||||
@@ -28,12 +27,7 @@ class FileUploadHandler:
|
||||
def handle_raw_input(
|
||||
self,
|
||||
input_data: Union[BytesIO, WSGIRequest],
|
||||
META: Dict[
|
||||
str,
|
||||
Union[
|
||||
Dict[str, str], Tuple[int, int], BytesIO, FakePayload, int, str
|
||||
],
|
||||
],
|
||||
META: Dict[str, Any],
|
||||
content_length: int,
|
||||
boundary: bytes,
|
||||
encoding: str = ...,
|
||||
@@ -75,12 +69,7 @@ class MemoryFileUploadHandler(FileUploadHandler):
|
||||
def handle_raw_input(
|
||||
self,
|
||||
input_data: Union[BytesIO, WSGIRequest],
|
||||
META: Dict[
|
||||
str,
|
||||
Union[
|
||||
Dict[str, str], Tuple[int, int], BytesIO, FakePayload, int, str
|
||||
],
|
||||
],
|
||||
META: Dict[str, Any],
|
||||
content_length: int,
|
||||
boundary: bytes,
|
||||
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.http.multipartparser import MultiPartParserError
|
||||
from django.http.response import Http404, HttpResponse
|
||||
from django.http.response import HttpResponse
|
||||
from django.urls.resolvers import URLResolver
|
||||
|
||||
|
||||
@@ -15,9 +13,7 @@ def get_exception_response(
|
||||
request: WSGIRequest,
|
||||
resolver: URLResolver,
|
||||
status_code: int,
|
||||
exception: Union[
|
||||
PermissionDenied, SuspiciousOperation, MultiPartParserError, Http404
|
||||
],
|
||||
exception: Exception,
|
||||
sender: None = ...,
|
||||
) -> HttpResponse: ...
|
||||
def handle_uncaught_exception(request: Any, resolver: Any, exc_info: Any): ...
|
||||
|
||||
@@ -51,28 +51,7 @@ class WSGIRequest(HttpRequest):
|
||||
method: str = ...
|
||||
encoding: Any = ...
|
||||
resolver_match: None = ...
|
||||
def __init__(
|
||||
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 __init__(self, environ: Dict[str, Any]) -> None: ...
|
||||
def GET(self) -> QueryDict: ...
|
||||
def COOKIES(self) -> Dict[str, str]: ...
|
||||
@property
|
||||
@@ -90,63 +69,11 @@ class WSGIHandler(base.BaseHandler):
|
||||
start_response: Callable,
|
||||
) -> HttpResponse: ...
|
||||
|
||||
def get_path_info(
|
||||
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_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_path_info(environ: Dict[str, Any]) -> str: ...
|
||||
def get_script_name(environ: Dict[str, Any]) -> str: ...
|
||||
def get_bytes_from_wsgi(
|
||||
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
|
||||
],
|
||||
],
|
||||
],
|
||||
key: str,
|
||||
default: str,
|
||||
environ: Dict[str, Any], key: str, default: str
|
||||
) -> bytes: ...
|
||||
def get_str_from_wsgi(
|
||||
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
|
||||
],
|
||||
],
|
||||
],
|
||||
key: str,
|
||||
default: str,
|
||||
environ: Dict[str, Any], key: str, default: str
|
||||
) -> str: ...
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
from argparse import (ArgumentParser, HelpFormatter, Namespace, _AppendAction,
|
||||
_HelpAction, _StoreAction, _StoreFalseAction,
|
||||
_StoreTrueAction, _VersionAction)
|
||||
from argparse import ArgumentParser, HelpFormatter, Namespace
|
||||
from io import StringIO, TextIOBase, TextIOWrapper
|
||||
from typing import Any, Callable, List, Optional, Tuple, Union
|
||||
|
||||
from django.contrib.admin.apps import SimpleAdminConfig
|
||||
from django.contrib.auth.apps import AuthConfig
|
||||
from django.apps.config import AppConfig
|
||||
|
||||
|
||||
class CommandError(Exception): ...
|
||||
@@ -37,34 +34,9 @@ def no_translations(handle_func: Callable) -> Callable: ...
|
||||
class DjangoHelpFormatter(HelpFormatter):
|
||||
show_last: Any = ...
|
||||
def add_usage(
|
||||
self,
|
||||
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,
|
||||
]
|
||||
],
|
||||
self, usage: None, actions: List[Any], *args: Any, **kwargs: Any
|
||||
) -> None: ...
|
||||
def add_arguments(self, actions: List[Any]) -> None: ...
|
||||
|
||||
class OutputWrapper(TextIOBase):
|
||||
@property
|
||||
@@ -116,7 +88,7 @@ class BaseCommand:
|
||||
) -> Optional[Union[Tuple, str]]: ...
|
||||
def check(
|
||||
self,
|
||||
app_configs: Optional[List[Union[SimpleAdminConfig, AuthConfig]]] = ...,
|
||||
app_configs: Optional[List[AppConfig]] = ...,
|
||||
tags: Optional[List[str]] = ...,
|
||||
display_num_errors: bool = ...,
|
||||
include_deployment_checks: bool = ...,
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
from collections import OrderedDict
|
||||
from io import StringIO
|
||||
from typing import Any, Callable, Dict, Iterator, List, Optional, Tuple, Union
|
||||
from typing import Any, Dict, Iterator, List, Optional, Tuple, Union
|
||||
|
||||
from django.core.management.base import BaseCommand, CommandParser
|
||||
from django.db.backends.base.introspection import FieldInfo
|
||||
@@ -17,12 +16,7 @@ class Command(BaseCommand):
|
||||
db_module: str = ...
|
||||
def add_arguments(self, parser: CommandParser) -> None: ...
|
||||
def handle(self, **options: Any) -> None: ...
|
||||
def handle_inspection(
|
||||
self,
|
||||
options: Dict[
|
||||
str, Optional[Union[Callable, List[str], StringIO, int, str]]
|
||||
],
|
||||
) -> Iterator[str]: ...
|
||||
def handle_inspection(self, options: Dict[str, Any]) -> Iterator[str]: ...
|
||||
def normalize_col_name(
|
||||
self, col_name: str, used_column_names: List[str], is_relation: bool
|
||||
) -> Tuple[str, Dict[str, str], List[str]]: ...
|
||||
@@ -37,7 +31,6 @@ class Command(BaseCommand):
|
||||
Union[
|
||||
Dict[str, Union[List[str], Tuple[str, str], bool]],
|
||||
Dict[str, Union[List[str], bool, str]],
|
||||
Dict[str, Union[List[str], bool]],
|
||||
],
|
||||
],
|
||||
column_to_field_name: Dict[str, str],
|
||||
|
||||
@@ -24,9 +24,7 @@ class Paginator:
|
||||
orphans: int = ...,
|
||||
allow_empty_first_page: bool = ...,
|
||||
) -> None: ...
|
||||
def validate_number(
|
||||
self, number: Optional[Union[float, int, str]]
|
||||
) -> int: ...
|
||||
def validate_number(self, number: Optional[Union[float, str]]) -> int: ...
|
||||
def get_page(self, number: Optional[int]) -> Page: ...
|
||||
def page(self, number: Union[int, str]) -> Page: ...
|
||||
def count(self) -> int: ...
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
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,
|
||||
Union)
|
||||
|
||||
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.xml_serializer import Deserializer, Serializer
|
||||
from django.db.models.base import Model
|
||||
@@ -27,7 +24,9 @@ def register_serializer(
|
||||
def unregister_serializer(format: str) -> None: ...
|
||||
def get_serializer(
|
||||
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_public_serializer_formats() -> List[str]: ...
|
||||
def get_deserializer(format: str) -> Union[Callable, Type[Deserializer]]: ...
|
||||
@@ -37,18 +36,10 @@ def serialize(
|
||||
**options: Any
|
||||
) -> Optional[Union[List[OrderedDict], bytes, str]]: ...
|
||||
def deserialize(
|
||||
format: str,
|
||||
stream_or_string: Union[
|
||||
List[OrderedDict],
|
||||
BufferedReader,
|
||||
StringIO,
|
||||
TextIOWrapper,
|
||||
SingleZipReader,
|
||||
GzipFile,
|
||||
str,
|
||||
],
|
||||
**options: Any
|
||||
format: str, stream_or_string: Any, **options: Any
|
||||
) -> Union[Iterator[Any], Deserializer]: ...
|
||||
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]]: ...
|
||||
|
||||
@@ -5,7 +5,6 @@ from io import BufferedReader, StringIO, TextIOWrapper
|
||||
from typing import Any, Dict, Iterator, List, Optional, Tuple, Type, Union
|
||||
from uuid import UUID
|
||||
|
||||
from django.core.exceptions import ObjectDoesNotExist, ValidationError
|
||||
from django.core.management.base import OutputWrapper
|
||||
from django.core.serializers.xml_serializer import Deserializer
|
||||
from django.db.models.base import Model
|
||||
@@ -20,7 +19,7 @@ class DeserializationError(Exception):
|
||||
@classmethod
|
||||
def WithData(
|
||||
cls,
|
||||
original_exc: Union[ObjectDoesNotExist, ValidationError],
|
||||
original_exc: Exception,
|
||||
model: str,
|
||||
fk: Union[int, str],
|
||||
field_value: Optional[Union[List[str], str]],
|
||||
@@ -30,9 +29,7 @@ class M2MDeserializationError(Exception):
|
||||
original_exc: django.core.exceptions.ObjectDoesNotExist = ...
|
||||
pk: List[str] = ...
|
||||
def __init__(
|
||||
self,
|
||||
original_exc: Union[ObjectDoesNotExist, ValidationError],
|
||||
pk: Union[List[str], str],
|
||||
self, original_exc: Exception, pk: Union[List[str], str]
|
||||
) -> None: ...
|
||||
|
||||
class ProgressBar:
|
||||
@@ -91,9 +88,7 @@ class DeserializedObject:
|
||||
object: django.db.models.base.Model = ...
|
||||
m2m_data: Dict[Any, Any] = ...
|
||||
def __init__(
|
||||
self,
|
||||
obj: Model,
|
||||
m2m_data: Optional[Dict[str, Union[List[Any], List[int]]]] = ...,
|
||||
self, obj: Model, m2m_data: Optional[Dict[str, List[int]]] = ...
|
||||
) -> None: ...
|
||||
def save(
|
||||
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[time, int]],
|
||||
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, UUID]],
|
||||
],
|
||||
|
||||
@@ -1,12 +1,9 @@
|
||||
import json
|
||||
from datetime import date, time, timedelta
|
||||
from decimal import Decimal
|
||||
from gzip import GzipFile
|
||||
from io import BufferedReader, StringIO, TextIOWrapper
|
||||
from typing import Any, Optional, Union
|
||||
from uuid import UUID
|
||||
|
||||
from django.core.management.commands.loaddata import SingleZipReader
|
||||
from django.core.serializers.python import Serializer as PythonSerializer
|
||||
from django.db.models.base import Model
|
||||
|
||||
@@ -26,12 +23,7 @@ class Serializer(PythonSerializer):
|
||||
def end_object(self, obj: Model) -> None: ...
|
||||
def getvalue(self) -> Optional[Union[bytes, str]]: ...
|
||||
|
||||
def Deserializer(
|
||||
stream_or_string: Union[
|
||||
BufferedReader, StringIO, TextIOWrapper, SingleZipReader, GzipFile, str
|
||||
],
|
||||
**options: Any
|
||||
) -> None: ...
|
||||
def Deserializer(stream_or_string: Any, **options: Any) -> None: ...
|
||||
|
||||
class DjangoJSONEncoder(json.JSONEncoder):
|
||||
allow_nan: bool
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
from collections import OrderedDict
|
||||
from datetime import date, datetime
|
||||
from datetime import date
|
||||
from typing import Any, Dict, Iterator, List, Optional, Union
|
||||
|
||||
from django.core.serializers import base
|
||||
@@ -29,16 +29,28 @@ class Serializer(base.Serializer):
|
||||
|
||||
def Deserializer(
|
||||
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[
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
Dict[str, Union[List[Any], List[int], datetime, int, str]],
|
||||
int,
|
||||
str,
|
||||
Dict[str, Union[List[Union[int, str]], int, str]], int, str
|
||||
],
|
||||
]
|
||||
],
|
||||
List[
|
||||
Dict[
|
||||
str,
|
||||
Union[Dict[str, Union[List[int], date, int, str]], int, str],
|
||||
]
|
||||
],
|
||||
List[
|
||||
Union[
|
||||
Dict[str, Optional[Union[Dict[str, Optional[str]], str]]],
|
||||
@@ -50,147 +62,42 @@ def Deserializer(
|
||||
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[
|
||||
Union[
|
||||
Dict[str, Union[Dict[Any, Any], date, 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, 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, bool], 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, 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[
|
||||
Union[
|
||||
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]],
|
||||
]
|
||||
],
|
||||
List[
|
||||
Union[
|
||||
Dict[str, Union[Dict[str, Union[List[Any], str]], int, str]],
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
Dict[str, Union[List[Any], List[List[str]], bool, str]],
|
||||
int,
|
||||
str,
|
||||
Dict[str, Union[List[List[str]], bool, 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[
|
||||
Union[
|
||||
Dict[str, Union[Dict[str, Union[List[Any], str]], int, str]],
|
||||
Dict[str, Union[Dict[str, str], int, str]],
|
||||
]
|
||||
],
|
||||
List[
|
||||
Union[
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
Dict[str, Union[List[List[str]], int, str]], int, str
|
||||
],
|
||||
str, Union[Dict[str, Union[List[int], bool, 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] = ...,
|
||||
flags: Optional[RegexFlag] = ...,
|
||||
) -> None: ...
|
||||
def __call__(self, value: Optional[Union[float, int, str]]) -> None: ...
|
||||
def __call__(self, value: Optional[Union[float, str]]) -> None: ...
|
||||
def __eq__(
|
||||
self, other: Union[ProhibitNullCharactersValidator, RegexValidator]
|
||||
) -> bool: ...
|
||||
@@ -45,7 +45,7 @@ class URLValidator(RegexValidator):
|
||||
|
||||
integer_validator: Any
|
||||
|
||||
def validate_integer(value: Optional[Union[float, int, str]]) -> None: ...
|
||||
def validate_integer(value: Optional[Union[float, str]]) -> None: ...
|
||||
|
||||
class EmailValidator:
|
||||
message: Any = ...
|
||||
@@ -92,17 +92,17 @@ class BaseValidator:
|
||||
limit_value: bool = ...
|
||||
def __init__(
|
||||
self,
|
||||
limit_value: Optional[Union[datetime, Decimal, float, int, str]],
|
||||
limit_value: Optional[Union[datetime, Decimal, float, str]],
|
||||
message: Optional[str] = ...,
|
||||
) -> None: ...
|
||||
def __call__(
|
||||
self, value: Union[bytes, datetime, Decimal, float, int, str]
|
||||
self, value: Union[bytes, datetime, Decimal, float, str]
|
||||
) -> None: ...
|
||||
def __eq__(self, other: BaseValidator) -> bool: ...
|
||||
def compare(self, a: bool, b: bool) -> bool: ...
|
||||
def clean(
|
||||
self, x: Union[datetime, Decimal, float, int]
|
||||
) -> Union[datetime, Decimal, float, int]: ...
|
||||
self, x: Union[datetime, Decimal, float]
|
||||
) -> Union[datetime, Decimal, float]: ...
|
||||
|
||||
class MaxValueValidator(BaseValidator):
|
||||
limit_value: decimal.Decimal
|
||||
@@ -110,8 +110,8 @@ class MaxValueValidator(BaseValidator):
|
||||
code: str = ...
|
||||
def compare(
|
||||
self,
|
||||
a: Union[datetime, Decimal, float, int],
|
||||
b: Union[datetime, Decimal, float, int],
|
||||
a: Union[datetime, Decimal, float],
|
||||
b: Union[datetime, Decimal, float],
|
||||
) -> bool: ...
|
||||
|
||||
class MinValueValidator(BaseValidator):
|
||||
@@ -120,8 +120,8 @@ class MinValueValidator(BaseValidator):
|
||||
code: str = ...
|
||||
def compare(
|
||||
self,
|
||||
a: Union[datetime, Decimal, float, int],
|
||||
b: Union[datetime, Decimal, float, int],
|
||||
a: Union[datetime, Decimal, float],
|
||||
b: Union[datetime, Decimal, float],
|
||||
) -> bool: ...
|
||||
|
||||
class MinLengthValidator(BaseValidator):
|
||||
|
||||
@@ -1,12 +1,7 @@
|
||||
from collections import deque
|
||||
from typing import Any, Callable, Dict, List, Optional, Union
|
||||
from typing import Any, Optional, Union
|
||||
from unittest.mock import MagicMock
|
||||
|
||||
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 \
|
||||
DJANGO_VERSION_PICKLE_KEY as DJANGO_VERSION_PICKLE_KEY
|
||||
@@ -24,21 +19,7 @@ connections: Any
|
||||
router: Any
|
||||
|
||||
class DefaultConnectionProxy:
|
||||
def __getattr__(
|
||||
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 __getattr__(self, item: str) -> Any: ...
|
||||
def __setattr__(self, name: str, value: Union[bool, MagicMock]) -> None: ...
|
||||
def __delattr__(self, name: str) -> None: ...
|
||||
def __eq__(self, other: DatabaseWrapper) -> bool: ...
|
||||
|
||||
@@ -27,7 +27,10 @@ class BaseDatabaseOperations:
|
||||
explain_prefix: Any = ...
|
||||
connection: django.db.DefaultConnectionProxy = ...
|
||||
def __init__(
|
||||
self, connection: Union[DefaultConnectionProxy, BaseDatabaseWrapper]
|
||||
self,
|
||||
connection: Union[
|
||||
DefaultConnectionProxy, backends.base.base.BaseDatabaseWrapper
|
||||
],
|
||||
) -> None: ...
|
||||
def autoinc_sql(self, table: str, column: str) -> None: ...
|
||||
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 convert_durationfield_value(
|
||||
self,
|
||||
value: Optional[Union[float, int]],
|
||||
value: Optional[float],
|
||||
expression: Expression,
|
||||
connection: DatabaseWrapper,
|
||||
) -> Optional[timedelta]: ...
|
||||
|
||||
@@ -77,7 +77,7 @@ class SQLiteCursorWrapper(Database.Cursor):
|
||||
query: str,
|
||||
params: Optional[
|
||||
Union[
|
||||
List[Optional[Union[float, int, str]]],
|
||||
List[Optional[Union[float, str]]],
|
||||
List[Optional[Union[int, memoryview, str]]],
|
||||
List[datetime],
|
||||
Tuple,
|
||||
|
||||
@@ -44,6 +44,5 @@ class DatabaseIntrospection(BaseDatabaseIntrospection):
|
||||
Union[
|
||||
Dict[str, Union[List[str], Tuple[str, str], bool]],
|
||||
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)
|
||||
from django.db.backends.utils import CursorDebugWrapper
|
||||
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.utils.datastructures import ImmutableList
|
||||
|
||||
@@ -85,7 +86,7 @@ class DatabaseOperations(BaseDatabaseOperations):
|
||||
connection: DatabaseWrapper,
|
||||
) -> Optional[time]: ...
|
||||
def get_decimalfield_converter(
|
||||
self, expression: Expression
|
||||
self, expression: Union[Col, SQLiteNumericMixin]
|
||||
) -> Callable: ...
|
||||
def convert_uuidfield_value(
|
||||
self, value: Optional[str], expression: Col, connection: DatabaseWrapper
|
||||
|
||||
@@ -33,7 +33,7 @@ class CursorWrapper:
|
||||
sql: str,
|
||||
params: Optional[
|
||||
Union[
|
||||
List[Optional[Union[float, int, str]]],
|
||||
List[Optional[Union[float, str]]],
|
||||
List[Optional[Union[int, memoryview, str]]],
|
||||
List[datetime],
|
||||
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.migration import Migration
|
||||
from django.db.migrations.operations.base import Operation
|
||||
from django.db.migrations.questioner import MigrationQuestioner
|
||||
from django.db.migrations.state import ProjectState
|
||||
from django.db.migrations.utils import RegexObject
|
||||
from django.db.models.fields import Field, IntegerField
|
||||
from django.db.models.fields import Field
|
||||
|
||||
from .topological_sort import stable_topological_sort
|
||||
|
||||
@@ -30,46 +28,7 @@ class MigrationAutodetector:
|
||||
convert_apps: Optional[Set[str]] = ...,
|
||||
migration_name: Optional[str] = ...,
|
||||
) -> Dict[str, List[Migration]]: ...
|
||||
def deep_deconstruct(
|
||||
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 deep_deconstruct(self, obj: Any) -> Any: ...
|
||||
def only_relation_agnostic_fields(
|
||||
self, fields: List[Tuple[str, Field]]
|
||||
) -> List[
|
||||
@@ -77,7 +36,6 @@ class MigrationAutodetector:
|
||||
str,
|
||||
List[Any],
|
||||
Union[
|
||||
Dict[Any, Any],
|
||||
Dict[str, Callable],
|
||||
Dict[str, Union[Callable, bool]],
|
||||
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.backends.base.base import BaseDatabaseWrapper
|
||||
from django.db.migrations.migration import Migration
|
||||
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:
|
||||
connection: django.db.backends.sqlite3.base.DatabaseWrapper
|
||||
loader: django.db.migrations.loader.MigrationLoader
|
||||
progress_callback: Callable
|
||||
recorder: django.db.migrations.recorder.MigrationRecorder
|
||||
|
||||
connection: django.db.backends.sqlite3.base.DatabaseWrapper = ...
|
||||
loader: django.db.migrations.loader.MigrationLoader = ...
|
||||
recorder: django.db.migrations.recorder.MigrationRecorder = ...
|
||||
progress_callback: Callable = ...
|
||||
def __init__(
|
||||
self,
|
||||
connection: Optional[Union[DefaultConnectionProxy, BaseDatabaseWrapper]],
|
||||
progress_callback: Optional[Callable] = ...
|
||||
connection: Optional[
|
||||
Union[
|
||||
DefaultConnectionProxy, backends.base.base.BaseDatabaseWrapper
|
||||
]
|
||||
],
|
||||
progress_callback: Optional[Callable] = ...,
|
||||
) -> 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(
|
||||
self,
|
||||
state: ProjectState,
|
||||
migration: Migration,
|
||||
fake: bool = ...,
|
||||
fake_initial: bool = ...
|
||||
fake_initial: bool = ...,
|
||||
) -> ProjectState: ...
|
||||
def unapply_migration(
|
||||
self, state: ProjectState, migration: Migration, fake: bool = ...
|
||||
) -> ProjectState: ...
|
||||
def check_replacements(self) -> None: ...
|
||||
def collect_sql(self, plan: List[Tuple[Migration, bool]]) -> List[str]: ...
|
||||
def detect_soft_applied(
|
||||
self,
|
||||
project_state: Optional[ProjectState],
|
||||
migration: Migration
|
||||
self, project_state: Optional[ProjectState], migration: Migration
|
||||
) -> 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__(
|
||||
self,
|
||||
connection: Optional[
|
||||
Union[DefaultConnectionProxy, BaseDatabaseWrapper]
|
||||
Union[
|
||||
DefaultConnectionProxy, backends.base.base.BaseDatabaseWrapper
|
||||
]
|
||||
],
|
||||
load: bool = ...,
|
||||
ignore_no_migrations: bool = ...,
|
||||
|
||||
@@ -1,18 +1,4 @@
|
||||
from typing import Any, List, Optional, Type, Union
|
||||
|
||||
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)
|
||||
from typing import Any, List, Optional, Type
|
||||
|
||||
|
||||
class Operation:
|
||||
@@ -21,30 +7,7 @@ class Operation:
|
||||
atomic: bool = ...
|
||||
elidable: bool = ...
|
||||
serialization_expand_args: Any = ...
|
||||
def __new__(
|
||||
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 __new__(cls: Type[Any], *args: Any, **kwargs: Any) -> Operation: ...
|
||||
def deconstruct(self): ...
|
||||
def state_forwards(self, app_label: Any, state: Any) -> None: ...
|
||||
def database_forwards(
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
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.migrations.operations.base import Operation
|
||||
from django.db.migrations.state import ProjectState
|
||||
from django.db.models.base import Model
|
||||
from django.db.models.fields import (AutoField, BooleanField, CharField, Field,
|
||||
IntegerField, SlugField)
|
||||
from django.db.models.fields import Field
|
||||
from django.db.models.indexes import Index
|
||||
from django.db.models.manager import Manager
|
||||
|
||||
@@ -36,7 +36,7 @@ class CreateModel(ModelOperation):
|
||||
def __init__(
|
||||
self,
|
||||
name: str,
|
||||
fields: List[Tuple[str, Field]],
|
||||
fields: List[Tuple[str, Union[CIText, Field]]],
|
||||
options: Optional[
|
||||
Union[
|
||||
Dict[str, Union[List[Any], bool]],
|
||||
@@ -52,55 +52,7 @@ class CreateModel(ModelOperation):
|
||||
) -> Tuple[
|
||||
str,
|
||||
List[Any],
|
||||
Union[
|
||||
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,
|
||||
],
|
||||
],
|
||||
],
|
||||
Dict[str, Union[Dict[str, str], List[Tuple[str, Field]], str]],
|
||||
]: ...
|
||||
def state_forwards(self, app_label: str, state: ProjectState) -> None: ...
|
||||
def database_forwards(
|
||||
|
||||
@@ -1,22 +1,9 @@
|
||||
from typing import Any, Callable, Dict, List, Optional, Set, Tuple, Union
|
||||
|
||||
from django.db.models.fields import Field
|
||||
|
||||
|
||||
class BaseSerializer:
|
||||
value: Any = ...
|
||||
def __init__(
|
||||
self,
|
||||
value: Union[
|
||||
Callable,
|
||||
List[Tuple[str, str]],
|
||||
Set[Tuple[str, str]],
|
||||
Tuple[str, Union[Field, str]],
|
||||
Field,
|
||||
int,
|
||||
str,
|
||||
],
|
||||
) -> None: ...
|
||||
def __init__(self, value: Any) -> None: ...
|
||||
def serialize(self) -> None: ...
|
||||
|
||||
class BaseSequenceSerializer(BaseSerializer):
|
||||
@@ -97,14 +84,4 @@ class TypeSerializer(BaseSerializer):
|
||||
class UUIDSerializer(BaseSerializer):
|
||||
def serialize(self): ...
|
||||
|
||||
def serializer_factory(
|
||||
value: Union[
|
||||
Callable,
|
||||
List[Tuple[str, str]],
|
||||
Set[Tuple[str, str]],
|
||||
Tuple[str, Union[Field, str]],
|
||||
Field,
|
||||
int,
|
||||
str,
|
||||
]
|
||||
) -> BaseSerializer: ...
|
||||
def serializer_factory(value: Any) -> BaseSerializer: ...
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
from typing import Any, Dict, Iterator, List, Optional, Set, Tuple, Type, Union
|
||||
|
||||
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.fields import Field
|
||||
from django.db.models.indexes import Index
|
||||
@@ -23,21 +24,21 @@ class ModelState:
|
||||
self,
|
||||
app_label: str,
|
||||
name: str,
|
||||
fields: List[Tuple[str, Field]],
|
||||
fields: List[Tuple[str, Union[CIText, Field]]],
|
||||
options: Optional[
|
||||
Union[
|
||||
Dict[str, Optional[List[Index]]],
|
||||
Dict[str, Union[List[Any], List[Tuple[str, str]], str]],
|
||||
Dict[str, Union[List[Index], bool, str]],
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
List[str],
|
||||
Set[Union[Tuple[str, str, str, str], Tuple[str, str]]],
|
||||
List[Tuple[str, str]],
|
||||
Set[Tuple[str, str]],
|
||||
Tuple[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], bool, str]],
|
||||
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.operations.base import Operation
|
||||
from django.db.models.fields import Field
|
||||
|
||||
|
||||
class SettingsReference(str):
|
||||
@@ -37,16 +36,6 @@ class MigrationWriter:
|
||||
@property
|
||||
def path(self) -> str: ...
|
||||
@classmethod
|
||||
def serialize(
|
||||
cls,
|
||||
value: Union[
|
||||
List[Tuple[str, str]],
|
||||
Set[Tuple[str, str]],
|
||||
Tuple[str, Union[Field, str]],
|
||||
bool,
|
||||
Field,
|
||||
str,
|
||||
],
|
||||
) -> Tuple[str, Set[str]]: ...
|
||||
def serialize(cls, value: Any) -> Tuple[str, Set[str]]: ...
|
||||
|
||||
MIGRATION_TEMPLATE: str
|
||||
|
||||
@@ -5,14 +5,12 @@ from uuid import UUID
|
||||
|
||||
from django.contrib.auth.models import AbstractUser, PermissionsMixin
|
||||
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.exceptions import (MultipleObjectsReturned,
|
||||
ObjectDoesNotExist, ValidationError)
|
||||
from django.db.models.fields import CharField, Field
|
||||
from django.db.models.fields.related import ForeignKey
|
||||
from django.db.models.manager import Manager
|
||||
from django.db.models.options import Options
|
||||
|
||||
|
||||
class Deferred: ...
|
||||
@@ -22,7 +20,8 @@ DEFERRED: Any
|
||||
def subclass_exception(
|
||||
name: str,
|
||||
bases: Tuple[
|
||||
Union[Type[MultipleObjectsReturned], Type[ObjectDoesNotExist]]
|
||||
Union[Type[MultipleObjectsReturned], Type[ObjectDoesNotExist]],
|
||||
Type[Exception],
|
||||
],
|
||||
module: str,
|
||||
attached_to: Type[Model],
|
||||
@@ -34,36 +33,20 @@ class ModelBase(type):
|
||||
name: str,
|
||||
bases: Tuple[Type[Model]],
|
||||
attrs: Union[
|
||||
Dict[str, Any],
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
Callable,
|
||||
Tuple[Tuple[int, str], Tuple[int, str]],
|
||||
Type[AbstractUser.Meta],
|
||||
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,
|
||||
],
|
||||
],
|
||||
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[
|
||||
str,
|
||||
Union[
|
||||
@@ -75,33 +58,11 @@ class ModelBase(type):
|
||||
str,
|
||||
],
|
||||
],
|
||||
Dict[str, Union[Type[AbstractUser.Meta], str]],
|
||||
],
|
||||
**kwargs: Any
|
||||
) -> Type[Model]: ...
|
||||
def add_to_class(
|
||||
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: ...
|
||||
def add_to_class(cls, name: str, value: Any) -> None: ...
|
||||
|
||||
class ModelStateFieldsCacheDescriptor:
|
||||
def __get__(
|
||||
@@ -129,12 +90,7 @@ class Model:
|
||||
Tuple[Union[int, str]],
|
||||
],
|
||||
) -> Model: ...
|
||||
def __eq__(
|
||||
self,
|
||||
other: Optional[
|
||||
Union[Dict[Any, Any], List[Any], Tuple, Model, int, str]
|
||||
],
|
||||
) -> bool: ...
|
||||
def __eq__(self, other: Any) -> bool: ...
|
||||
def __hash__(self) -> int: ...
|
||||
def __reduce__(self): ...
|
||||
pk: Any = ...
|
||||
|
||||
@@ -6,10 +6,10 @@ from typing import (Any, Callable, Dict, Iterator, List, Optional, Set, Tuple,
|
||||
from uuid import UUID
|
||||
|
||||
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,
|
||||
CharField, DateField, DurationField,
|
||||
Field, IntegerField, TimeField, UUIDField)
|
||||
DateTimeField, DurationField, Field,
|
||||
IntegerField, TimeField, UUIDField)
|
||||
from django.db.models.fields.mixins import FieldCacheMixin
|
||||
from django.db.models.fields.reverse_related import ForeignObjectRel
|
||||
from django.db.models.functions.window import DenseRank
|
||||
@@ -45,20 +45,16 @@ class Combinable:
|
||||
BITLEFTSHIFT: str = ...
|
||||
BITRIGHTSHIFT: str = ...
|
||||
def __neg__(self) -> CombinedExpression: ...
|
||||
def __add__(
|
||||
self, other: Optional[Union[timedelta, Combinable, float, int, str]]
|
||||
) -> CombinedExpression: ...
|
||||
def __add__(self, other: Any) -> CombinedExpression: ...
|
||||
def __sub__(
|
||||
self, other: Union[timedelta, Combinable, float, int]
|
||||
self, other: Union[timedelta, Combinable, float]
|
||||
) -> CombinedExpression: ...
|
||||
def __mul__(
|
||||
self, other: Union[timedelta, Combinable, float, int]
|
||||
) -> CombinedExpression: ...
|
||||
def __truediv__(
|
||||
self, other: Union[Count, float, int]
|
||||
self, other: Union[timedelta, Combinable, float]
|
||||
) -> CombinedExpression: ...
|
||||
def __truediv__(self, other: Union[Count, float]) -> 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 bitand(self, other: int) -> CombinedExpression: ...
|
||||
def bitleftshift(self, other: int) -> CombinedExpression: ...
|
||||
@@ -66,13 +62,13 @@ class Combinable:
|
||||
def __or__(self, other: Combinable) -> Any: ...
|
||||
def bitor(self, other: int) -> CombinedExpression: ...
|
||||
def __radd__(
|
||||
self, other: Optional[Union[datetime, timedelta, float, int]]
|
||||
self, other: Optional[Union[datetime, timedelta, float]]
|
||||
) -> CombinedExpression: ...
|
||||
def __rsub__(self, other: Union[float, int]) -> CombinedExpression: ...
|
||||
def __rmul__(self, other: Union[float, int]) -> CombinedExpression: ...
|
||||
def __rtruediv__(self, other: Union[float, int]) -> CombinedExpression: ...
|
||||
def __rsub__(self, other: float) -> CombinedExpression: ...
|
||||
def __rmul__(self, other: float) -> CombinedExpression: ...
|
||||
def __rtruediv__(self, other: float) -> 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 __ror__(self, other: Any) -> Any: ...
|
||||
|
||||
@@ -105,7 +101,7 @@ class BaseExpression:
|
||||
for_save: bool = ...,
|
||||
) -> BaseExpression: ...
|
||||
@property
|
||||
def field(self) -> Union[Field, mixins.FieldCacheMixin]: ...
|
||||
def field(self) -> Union[Field, ForeignObjectRel]: ...
|
||||
def output_field(self) -> Field: ...
|
||||
def convert_value(self) -> Callable: ...
|
||||
def get_lookup(self, lookup: str) -> Optional[Type[Lookup]]: ...
|
||||
@@ -136,7 +132,9 @@ class CombinedExpression(SQLiteNumericMixin, Expression):
|
||||
rhs: Combinable,
|
||||
output_field: 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 as_sql(
|
||||
self, compiler: SQLCompiler, connection: DatabaseWrapper
|
||||
@@ -213,7 +211,7 @@ class Func(SQLiteNumericMixin, Expression):
|
||||
def __init__(
|
||||
self, *expressions: Any, output_field: Optional[Any] = ..., **extra: Any
|
||||
) -> 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 resolve_expression(
|
||||
self,
|
||||
@@ -240,11 +238,7 @@ class Func(SQLiteNumericMixin, Expression):
|
||||
class Value(Expression):
|
||||
value: Any = ...
|
||||
def __init__(
|
||||
self,
|
||||
value: Optional[
|
||||
Union[bytes, date, time, timedelta, Decimal, float, int, str, UUID]
|
||||
],
|
||||
output_field: Optional[Field] = ...,
|
||||
self, value: Any, output_field: Optional[Field] = ...
|
||||
) -> None: ...
|
||||
def as_sql(
|
||||
self, compiler: SQLCompiler, connection: DatabaseWrapper
|
||||
@@ -307,7 +301,9 @@ class Col(Expression):
|
||||
self,
|
||||
alias: str,
|
||||
target: Union[Field, str],
|
||||
output_field: Optional[Union[Field, mixins.FieldCacheMixin]] = ...,
|
||||
output_field: Optional[
|
||||
Union[Field, reverse_related.ForeignObjectRel]
|
||||
] = ...,
|
||||
) -> None: ...
|
||||
def as_sql(
|
||||
self, compiler: SQLCompiler, connection: DatabaseWrapper
|
||||
@@ -320,9 +316,7 @@ class Col(Expression):
|
||||
|
||||
class Ref(Expression):
|
||||
def __init__(self, refs: str, source: Expression) -> None: ...
|
||||
def get_source_expressions(
|
||||
self
|
||||
) -> Union[List[Expression], List[SQLiteNumericMixin]]: ...
|
||||
def get_source_expressions(self) -> List[Expression]: ...
|
||||
def set_source_expressions(self, exprs: Any) -> None: ...
|
||||
def resolve_expression(
|
||||
self,
|
||||
@@ -363,10 +357,7 @@ class When(Expression):
|
||||
condition: Any = ...
|
||||
result: Any = ...
|
||||
def __init__(
|
||||
self,
|
||||
condition: Any = ...,
|
||||
then: Optional[Union[date, Decimal, Combinable, float, int, str]] = ...,
|
||||
**lookups: Any
|
||||
self, condition: Any = ..., then: Any = ..., **lookups: Any
|
||||
) -> None: ...
|
||||
def get_source_expressions(self) -> List[Union[Expression, WhereNode]]: ...
|
||||
def set_source_expressions(
|
||||
@@ -393,9 +384,9 @@ class When(Expression):
|
||||
List[Union[date, int]],
|
||||
List[Union[date, str]],
|
||||
List[Union[Decimal, int]],
|
||||
List[Union[float, int]],
|
||||
List[Union[int, memoryview]],
|
||||
List[Union[int, str]],
|
||||
List[float],
|
||||
],
|
||||
]: ...
|
||||
def get_group_by_cols(self) -> List[Col]: ...
|
||||
@@ -437,9 +428,9 @@ class Case(Expression):
|
||||
List[Union[date, int]],
|
||||
List[Union[date, str]],
|
||||
List[Union[Decimal, int]],
|
||||
List[Union[float, int]],
|
||||
List[Union[int, memoryview]],
|
||||
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 uuid import UUID
|
||||
|
||||
from django.contrib.auth.validators import UnicodeUsernameValidator
|
||||
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.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.forms.fields import (DecimalField, Field, ImageField, IntegerField,
|
||||
TypedChoiceField, URLField)
|
||||
from django.db.models.sql.compiler import SQLCompiler, SQLInsertCompiler
|
||||
from django.forms.fields import (BooleanField, DurationField, EmailField,
|
||||
Field, FloatField, GenericIPAddressField,
|
||||
IntegerField, SlugField,
|
||||
TypedMultipleChoiceField, URLField, UUIDField)
|
||||
from django.utils.datastructures import DictWrapper
|
||||
|
||||
|
||||
class Empty: ...
|
||||
@@ -51,99 +62,167 @@ class Field(RegisterLookupMixin):
|
||||
def __init__(
|
||||
self,
|
||||
verbose_name: Optional[str] = ...,
|
||||
name: None = ...,
|
||||
name: Optional[str] = ...,
|
||||
primary_key: bool = ...,
|
||||
max_length: Optional[int] = ...,
|
||||
unique: bool = ...,
|
||||
blank: bool = ...,
|
||||
null: bool = ...,
|
||||
db_index: bool = ...,
|
||||
rel: Optional[ManyToOneRel] = ...,
|
||||
default: Union[Callable, Type[NOT_PROVIDED]] = ...,
|
||||
rel: Optional[ForeignObjectRel] = ...,
|
||||
default: Any = ...,
|
||||
editable: bool = ...,
|
||||
serialize: bool = ...,
|
||||
unique_for_date: Optional[str] = ...,
|
||||
unique_for_month: Optional[str] = ...,
|
||||
unique_for_year: Optional[str] = ...,
|
||||
unique_for_date: None = ...,
|
||||
unique_for_month: None = ...,
|
||||
unique_for_year: None = ...,
|
||||
choices: Optional[
|
||||
Union[
|
||||
List[Tuple[str, str]],
|
||||
List[Tuple[int, str]],
|
||||
Tuple[Tuple[int, str], Tuple[int, str], Tuple[int, str]],
|
||||
Tuple[Tuple[str, str], Tuple[str, str]],
|
||||
List[List[Union[List[List[str]], str]]],
|
||||
List[
|
||||
Tuple[
|
||||
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 = ...,
|
||||
db_column: None = ...,
|
||||
db_column: Optional[str] = ...,
|
||||
db_tablespace: Optional[str] = ...,
|
||||
auto_created: bool = ...,
|
||||
validators: Union[List[RegexValidator], Tuple] = ...,
|
||||
error_messages: Optional[Dict[str, str]] = ...,
|
||||
validators: Union[List[Callable], Tuple] = ...,
|
||||
error_messages: None = ...,
|
||||
) -> None: ...
|
||||
def check(self, **kwargs: Any): ...
|
||||
def get_col(self, alias: Any, output_field: Optional[Any] = ...): ...
|
||||
def cached_col(self): ...
|
||||
def select_format(self, compiler: Any, sql: Any, params: Any): ...
|
||||
def check(self, **kwargs: Any) -> List[Any]: ...
|
||||
def get_col(
|
||||
self,
|
||||
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(
|
||||
self
|
||||
) -> Union[
|
||||
Tuple[None, str, List[Any], Dict[str, Union[List[Callable], int, str]]],
|
||||
Tuple[
|
||||
str,
|
||||
List[Any],
|
||||
Union[
|
||||
Dict[str, Union[int, List[RegexValidator], Dict[str, str]]],
|
||||
Dict[str, Union[bool, List[Tuple[int, str]]]],
|
||||
Dict[str, Union[Callable, List[Tuple[int, str]]]],
|
||||
Dict[str, int],
|
||||
Dict[str, Optional[bool]],
|
||||
Dict[str, Union[Callable, int, str]],
|
||||
Dict[str, Union[List[Tuple[int, 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[
|
||||
Dict[str, Union[int, List[RegexValidator], Dict[str, str]]],
|
||||
Dict[str, Union[bool, List[Tuple[int, str]]]],
|
||||
Dict[str, Union[Callable, List[Tuple[int, str]]]],
|
||||
Dict[str, int],
|
||||
Dict[Any, Any],
|
||||
Dict[str, Optional[bool]],
|
||||
Dict[str, Union[Callable, int, str]],
|
||||
Dict[str, Union[List[Tuple[int, 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],
|
||||
],
|
||||
],
|
||||
Tuple[
|
||||
str,
|
||||
List[Any],
|
||||
Union[
|
||||
Dict[str, Union[int, Callable, List[Tuple[str, str]]]],
|
||||
Dict[str, Union[Callable, List[Tuple[int, str]]]],
|
||||
Dict[str, Union[int, List[RegexValidator], Dict[str, str]]],
|
||||
Dict[str, Optional[bool]],
|
||||
Dict[str, Union[List[Tuple[int, str]], str]],
|
||||
],
|
||||
Union[
|
||||
Dict[str, Union[int, Callable, List[Tuple[str, str]]]],
|
||||
Dict[str, Union[Callable, List[Tuple[int, str]]]],
|
||||
Dict[str, Union[int, List[RegexValidator], Dict[str, str]]],
|
||||
Dict[str, List[Tuple[int, str]]],
|
||||
Dict[str, Optional[bool]],
|
||||
Dict[str, Union[List[Tuple[int, str]], str]],
|
||||
],
|
||||
],
|
||||
]: ...
|
||||
def clone(self) -> Field: ...
|
||||
def __eq__(self, other: CharField) -> bool: ...
|
||||
def __eq__(self, other: Field) -> bool: ...
|
||||
def __lt__(self, other: Field) -> bool: ...
|
||||
def __hash__(self): ...
|
||||
def __deepcopy__(self, memodict: Dict[Any, Any]) -> Field: ...
|
||||
def __hash__(self) -> int: ...
|
||||
def __deepcopy__(
|
||||
self,
|
||||
memodict: Union[
|
||||
Dict[int, Any],
|
||||
Dict[int, Union[Dict[str, Field], List[Field], Field]],
|
||||
],
|
||||
) -> Field: ...
|
||||
def __copy__(self) -> Field: ...
|
||||
def __reduce__(self): ...
|
||||
def get_pk_value_on_save(self, instance: Model) -> None: ...
|
||||
def to_python(self, value: Any): ...
|
||||
def validators(
|
||||
self
|
||||
) -> Union[List[RegexValidator], List[EmailValidator]]: ...
|
||||
def run_validators(self, value: Any): ...
|
||||
def validate(self, value: Any, model_instance: Any): ...
|
||||
def clean(self, value: Any, model_instance: Any): ...
|
||||
def db_type_parameters(self, connection: Any): ...
|
||||
def db_check(self, connection: Any): ...
|
||||
def db_type(self, connection: Any): ...
|
||||
def rel_db_type(self, connection: Any): ...
|
||||
def get_pk_value_on_save(self, instance: Model) -> Optional[UUID]: ...
|
||||
def to_python(self, value: FieldFile) -> FieldFile: ...
|
||||
def validators(self) -> List[Callable]: ...
|
||||
def run_validators(self, value: Any) -> None: ...
|
||||
def validate(self, value: Any, model_instance: Optional[Model]) -> None: ...
|
||||
def clean(self, value: Any, model_instance: Optional[Model]) -> Any: ...
|
||||
def db_type_parameters(
|
||||
self, connection: DatabaseWrapper
|
||||
) -> DictWrapper: ...
|
||||
def db_check(self, connection: DatabaseWrapper) -> None: ...
|
||||
def db_type(self, connection: DatabaseWrapper) -> str: ...
|
||||
def rel_db_type(self, connection: DatabaseWrapper) -> str: ...
|
||||
def cast_db_type(self, connection: Any): ...
|
||||
def db_parameters(self, connection: Any): ...
|
||||
def db_type_suffix(self, connection: Any): ...
|
||||
def get_db_converters(self, connection: Any): ...
|
||||
def db_parameters(
|
||||
self, connection: DatabaseWrapper
|
||||
) -> Dict[str, Optional[str]]: ...
|
||||
def db_type_suffix(self, connection: DatabaseWrapper) -> Optional[str]: ...
|
||||
def get_db_converters(
|
||||
self, connection: DatabaseWrapper
|
||||
) -> List[Callable]: ...
|
||||
@property
|
||||
def unique(self): ...
|
||||
def unique(self) -> bool: ...
|
||||
@property
|
||||
def db_tablespace(self) -> str: ...
|
||||
concrete: Any = ...
|
||||
@@ -155,75 +234,116 @@ class Field(RegisterLookupMixin):
|
||||
def get_filter_kwargs_for_object(self, obj: Any): ...
|
||||
def get_attname(self) -> str: ...
|
||||
def get_attname_column(self) -> Tuple[str, str]: ...
|
||||
def get_internal_type(self): ...
|
||||
def pre_save(self, model_instance: Model, add: bool) -> Union[str, int]: ...
|
||||
def get_prep_value(self, value: Any): ...
|
||||
def get_internal_type(self) -> str: ...
|
||||
def pre_save(self, model_instance: Model, add: bool) -> Any: ...
|
||||
def get_prep_value(self, value: Any) -> Any: ...
|
||||
def get_db_prep_value(
|
||||
self, value: int, connection: DatabaseWrapper, prepared: bool = ...
|
||||
) -> int: ...
|
||||
def get_db_prep_save(self, value: Any, connection: Any): ...
|
||||
self, value: Any, connection: DatabaseWrapper, prepared: bool = ...
|
||||
) -> Optional[Union[bytes, float, str]]: ...
|
||||
def get_db_prep_save(
|
||||
self, value: Any, connection: DatabaseWrapper
|
||||
) -> Optional[Union[float, memoryview, str]]: ...
|
||||
def has_default(self) -> bool: ...
|
||||
def get_default(self): ...
|
||||
def get_default(self) -> Any: ...
|
||||
def get_choices(
|
||||
self,
|
||||
include_blank: bool = ...,
|
||||
blank_choice: List[Tuple[str, str]] = ...,
|
||||
limit_choices_to: None = ...,
|
||||
) -> List[Tuple[str, str]]: ...
|
||||
def value_to_string(self, obj: Any): ...
|
||||
limit_choices_to: Optional[Dict[str, QuerySet]] = ...,
|
||||
) -> List[
|
||||
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 = ...
|
||||
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(
|
||||
self,
|
||||
form_class: Type[Union[IntegerField, URLField, ImageField]] = ...,
|
||||
choices_form_class: None = ...,
|
||||
form_class: Optional[Type[Any]] = ...,
|
||||
choices_form_class: Optional[Type[TypedMultipleChoiceField]] = ...,
|
||||
**kwargs: Any
|
||||
) -> Field: ...
|
||||
def value_from_object(self, obj: Any): ...
|
||||
def value_from_object(self, obj: Model) -> Any: ...
|
||||
|
||||
class AutoField(Field):
|
||||
description: Any = ...
|
||||
empty_strings_allowed: bool = ...
|
||||
default_error_messages: Any = ...
|
||||
def __init__(self, *args: Any, **kwargs: Any) -> None: ...
|
||||
def check(self, **kwargs: Any): ...
|
||||
def deconstruct(self): ...
|
||||
def get_internal_type(self): ...
|
||||
def to_python(self, value: Any): ...
|
||||
def rel_db_type(self, connection: Any): ...
|
||||
def check(self, **kwargs: Any) -> List[Any]: ...
|
||||
def deconstruct(
|
||||
self
|
||||
) -> Union[
|
||||
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 get_db_prep_value(
|
||||
self, value: Any, connection: Any, prepared: bool = ...
|
||||
): ...
|
||||
def get_prep_value(self, value: Any): ...
|
||||
self,
|
||||
value: Union[int, str],
|
||||
connection: DatabaseWrapper,
|
||||
prepared: bool = ...,
|
||||
) -> Union[int, str]: ...
|
||||
def get_prep_value(
|
||||
self, value: Optional[Union[int, str]]
|
||||
) -> Optional[int]: ...
|
||||
def contribute_to_class(
|
||||
self, cls: Type[Model], name: str, **kwargs: Any
|
||||
) -> None: ...
|
||||
def formfield(self, **kwargs: Any): ...
|
||||
def formfield(self, **kwargs: Any) -> None: ...
|
||||
|
||||
class BigAutoField(AutoField):
|
||||
description: Any = ...
|
||||
def get_internal_type(self): ...
|
||||
def rel_db_type(self, connection: Any): ...
|
||||
def get_internal_type(self) -> str: ...
|
||||
def rel_db_type(self, connection: DatabaseWrapper) -> str: ...
|
||||
|
||||
class BooleanField(Field):
|
||||
empty_strings_allowed: bool = ...
|
||||
default_error_messages: Any = ...
|
||||
description: Any = ...
|
||||
def get_internal_type(self): ...
|
||||
def to_python(self, value: Any): ...
|
||||
def get_prep_value(self, value: Any): ...
|
||||
def formfield(self, **kwargs: Any): ...
|
||||
def get_internal_type(self) -> str: ...
|
||||
def to_python(self, value: Optional[Union[bool, str]]) -> bool: ...
|
||||
def get_prep_value(
|
||||
self, value: Optional[Union[bool, str]]
|
||||
) -> Optional[bool]: ...
|
||||
def formfield(self, **kwargs: Any) -> BooleanField: ...
|
||||
|
||||
class CharField(Field):
|
||||
description: Any = ...
|
||||
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 get_internal_type(self): ...
|
||||
def to_python(self, value: Any): ...
|
||||
def get_prep_value(self, value: Any): ...
|
||||
def formfield(self, **kwargs: Any) -> URLField: ...
|
||||
def get_internal_type(self) -> str: ...
|
||||
def to_python(
|
||||
self, value: Optional[Union[Model, int, str]]
|
||||
) -> Optional[str]: ...
|
||||
def get_prep_value(
|
||||
self, value: Optional[Union[Model, str]]
|
||||
) -> Optional[str]: ...
|
||||
def formfield(self, **kwargs: Any) -> Field: ...
|
||||
|
||||
class CommaSeparatedIntegerField(CharField):
|
||||
default_validators: Any = ...
|
||||
@@ -231,7 +351,7 @@ class CommaSeparatedIntegerField(CharField):
|
||||
system_check_removed_details: Any = ...
|
||||
|
||||
class DateTimeCheckMixin:
|
||||
def check(self, **kwargs: Any): ...
|
||||
def check(self, **kwargs: Any) -> List[Any]: ...
|
||||
|
||||
class DateField(DateTimeCheckMixin, Field):
|
||||
empty_strings_allowed: bool = ...
|
||||
@@ -239,39 +359,67 @@ class DateField(DateTimeCheckMixin, Field):
|
||||
description: Any = ...
|
||||
def __init__(
|
||||
self,
|
||||
verbose_name: Optional[Any] = ...,
|
||||
name: Optional[Any] = ...,
|
||||
verbose_name: Optional[str] = ...,
|
||||
name: None = ...,
|
||||
auto_now: bool = ...,
|
||||
auto_now_add: bool = ...,
|
||||
**kwargs: Any
|
||||
) -> None: ...
|
||||
def deconstruct(self): ...
|
||||
def get_internal_type(self): ...
|
||||
def to_python(self, value: Any): ...
|
||||
def pre_save(self, model_instance: Any, add: Any): ...
|
||||
def deconstruct(
|
||||
self
|
||||
) -> Union[
|
||||
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(
|
||||
self, cls: Type[Model], name: str, **kwargs: Any
|
||||
) -> 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(
|
||||
self, value: Any, connection: Any, prepared: bool = ...
|
||||
): ...
|
||||
def value_to_string(self, obj: Any): ...
|
||||
def formfield(self, **kwargs: Any): ...
|
||||
self,
|
||||
value: Optional[date],
|
||||
connection: DatabaseWrapper,
|
||||
prepared: bool = ...,
|
||||
) -> Optional[str]: ...
|
||||
def value_to_string(self, obj: Model) -> str: ...
|
||||
def formfield(self, **kwargs: Any) -> Field: ...
|
||||
|
||||
class DateTimeField(DateField):
|
||||
empty_strings_allowed: bool = ...
|
||||
default_error_messages: Any = ...
|
||||
description: Any = ...
|
||||
def get_internal_type(self): ...
|
||||
def to_python(self, value: Any): ...
|
||||
def pre_save(self, model_instance: Any, add: Any): ...
|
||||
def get_prep_value(self, value: Any): ...
|
||||
def get_internal_type(self) -> str: ...
|
||||
def to_python(
|
||||
self, value: Optional[Union[datetime, str]]
|
||||
) -> 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(
|
||||
self, value: Any, connection: Any, prepared: bool = ...
|
||||
): ...
|
||||
def value_to_string(self, obj: Any): ...
|
||||
def formfield(self, **kwargs: Any): ...
|
||||
self,
|
||||
value: Optional[datetime],
|
||||
connection: DatabaseWrapper,
|
||||
prepared: bool = ...,
|
||||
) -> Optional[str]: ...
|
||||
def value_to_string(self, obj: Model) -> str: ...
|
||||
def formfield(self, **kwargs: Any) -> Field: ...
|
||||
|
||||
class DecimalField(Field):
|
||||
empty_strings_allowed: bool = ...
|
||||
@@ -279,62 +427,64 @@ class DecimalField(Field):
|
||||
description: Any = ...
|
||||
def __init__(
|
||||
self,
|
||||
verbose_name: Optional[Any] = ...,
|
||||
name: Optional[Any] = ...,
|
||||
max_digits: Optional[Any] = ...,
|
||||
decimal_places: Optional[Any] = ...,
|
||||
verbose_name: None = ...,
|
||||
name: None = ...,
|
||||
max_digits: Optional[int] = ...,
|
||||
decimal_places: Optional[int] = ...,
|
||||
**kwargs: Any
|
||||
) -> None: ...
|
||||
def check(self, **kwargs: Any): ...
|
||||
def validators(self): ...
|
||||
def context(self): ...
|
||||
def deconstruct(self): ...
|
||||
def get_internal_type(self): ...
|
||||
def to_python(self, value: Any): ...
|
||||
def get_db_prep_save(self, value: Any, connection: Any): ...
|
||||
def get_prep_value(self, value: Any): ...
|
||||
def formfield(self, **kwargs: Any) -> DecimalField: ...
|
||||
def check(self, **kwargs: Any) -> List[Any]: ...
|
||||
def validators(self) -> List[DecimalValidator]: ...
|
||||
def context(self) -> Context: ...
|
||||
def deconstruct(
|
||||
self
|
||||
) -> Tuple[str, List[Any], Dict[str, int], Dict[str, int]]: ...
|
||||
def get_internal_type(self) -> str: ...
|
||||
def to_python(self, value: Optional[str]) -> Optional[Decimal]: ...
|
||||
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):
|
||||
empty_strings_allowed: bool = ...
|
||||
default_error_messages: Any = ...
|
||||
description: Any = ...
|
||||
def get_internal_type(self): ...
|
||||
def to_python(self, value: Any): ...
|
||||
def get_internal_type(self) -> str: ...
|
||||
def to_python(self, value: str) -> timedelta: ...
|
||||
def get_db_prep_value(
|
||||
self, value: Any, connection: Any, prepared: bool = ...
|
||||
): ...
|
||||
def get_db_converters(self, connection: Any): ...
|
||||
def value_to_string(self, obj: Any): ...
|
||||
def formfield(self, **kwargs: Any): ...
|
||||
def value_to_string(self, obj: Model) -> str: ...
|
||||
def formfield(self, **kwargs: Any) -> DurationField: ...
|
||||
|
||||
class EmailField(CharField):
|
||||
default_validators: Any = ...
|
||||
description: Any = ...
|
||||
def __init__(self, *args: Any, **kwargs: Any) -> None: ...
|
||||
def deconstruct(self): ...
|
||||
def formfield(self, **kwargs: Any): ...
|
||||
def deconstruct(
|
||||
self
|
||||
) -> Tuple[str, List[Any], Dict[str, int], Dict[str, int]]: ...
|
||||
def formfield(self, **kwargs: Any) -> EmailField: ...
|
||||
|
||||
class FilePathField(Field):
|
||||
description: Any = ...
|
||||
def __init__(
|
||||
self,
|
||||
verbose_name: None = ...,
|
||||
name: None = ...,
|
||||
verbose_name: Optional[Any] = ...,
|
||||
name: Optional[Any] = ...,
|
||||
path: str = ...,
|
||||
match: str = ...,
|
||||
match: Optional[Any] = ...,
|
||||
recursive: bool = ...,
|
||||
allow_files: bool = ...,
|
||||
allow_folders: bool = ...,
|
||||
**kwargs: Any
|
||||
) -> None: ...
|
||||
def check(self, **kwargs: Any): ...
|
||||
def deconstruct(
|
||||
self
|
||||
) -> Tuple[
|
||||
str, List[Any], Dict[str, Union[str, bool]], Dict[str, Union[str, bool]]
|
||||
]: ...
|
||||
def get_prep_value(self, value: Any): ...
|
||||
def deconstruct(self): ...
|
||||
def get_prep_value(self, value: Optional[str]) -> Optional[str]: ...
|
||||
def formfield(self, **kwargs: Any): ...
|
||||
def get_internal_type(self): ...
|
||||
|
||||
@@ -342,37 +492,39 @@ class FloatField(Field):
|
||||
empty_strings_allowed: bool = ...
|
||||
default_error_messages: Any = ...
|
||||
description: Any = ...
|
||||
def get_prep_value(self, value: Any): ...
|
||||
def get_internal_type(self): ...
|
||||
def to_python(self, value: Any): ...
|
||||
def formfield(self, **kwargs: Any): ...
|
||||
def get_prep_value(self, value: Union[float, str]) -> float: ...
|
||||
def get_internal_type(self) -> str: ...
|
||||
def to_python(self, value: Union[float, str]) -> float: ...
|
||||
def formfield(self, **kwargs: Any) -> FloatField: ...
|
||||
|
||||
class IntegerField(Field):
|
||||
empty_strings_allowed: bool = ...
|
||||
default_error_messages: Any = ...
|
||||
description: Any = ...
|
||||
def check(self, **kwargs: Any): ...
|
||||
def validators(self): ...
|
||||
def get_prep_value(self, value: Any): ...
|
||||
def get_internal_type(self): ...
|
||||
def to_python(self, value: Any): ...
|
||||
def check(self, **kwargs: Any) -> List[Any]: ...
|
||||
def validators(self) -> List[Any]: ...
|
||||
def get_prep_value(
|
||||
self, value: Optional[Union[int, str]]
|
||||
) -> Optional[int]: ...
|
||||
def get_internal_type(self) -> str: ...
|
||||
def to_python(self, value: Union[int, str]) -> int: ...
|
||||
def formfield(self, **kwargs: Any) -> Field: ...
|
||||
|
||||
class BigIntegerField(IntegerField):
|
||||
empty_strings_allowed: bool = ...
|
||||
description: Any = ...
|
||||
MAX_BIGINT: int = ...
|
||||
def get_internal_type(self): ...
|
||||
def formfield(self, **kwargs: Any) -> IntegerField: ...
|
||||
def get_internal_type(self) -> str: ...
|
||||
def formfield(self, **kwargs: Any): ...
|
||||
|
||||
class IPAddressField(Field):
|
||||
empty_strings_allowed: bool = ...
|
||||
description: Any = ...
|
||||
system_check_removed_details: Any = ...
|
||||
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_internal_type(self): ...
|
||||
def get_internal_type(self) -> str: ...
|
||||
|
||||
class GenericIPAddressField(Field):
|
||||
empty_strings_allowed: bool = ...
|
||||
@@ -392,12 +544,15 @@ class GenericIPAddressField(Field):
|
||||
def check(self, **kwargs: Any): ...
|
||||
def deconstruct(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(
|
||||
self, value: Any, connection: Any, prepared: bool = ...
|
||||
): ...
|
||||
def get_prep_value(self, value: Any): ...
|
||||
def formfield(self, **kwargs: Any): ...
|
||||
self,
|
||||
value: Optional[str],
|
||||
connection: DatabaseWrapper,
|
||||
prepared: bool = ...,
|
||||
) -> Optional[str]: ...
|
||||
def get_prep_value(self, value: Optional[str]) -> Optional[str]: ...
|
||||
def formfield(self, **kwargs: Any) -> GenericIPAddressField: ...
|
||||
|
||||
class NullBooleanField(BooleanField):
|
||||
default_error_messages: Any = ...
|
||||
@@ -411,12 +566,12 @@ class PositiveIntegerRelDbTypeMixin:
|
||||
|
||||
class PositiveIntegerField(PositiveIntegerRelDbTypeMixin, IntegerField):
|
||||
description: Any = ...
|
||||
def get_internal_type(self): ...
|
||||
def formfield(self, **kwargs: Any) -> TypedChoiceField: ...
|
||||
def get_internal_type(self) -> str: ...
|
||||
def formfield(self, **kwargs: Any) -> IntegerField: ...
|
||||
|
||||
class PositiveSmallIntegerField(PositiveIntegerRelDbTypeMixin, IntegerField):
|
||||
description: Any = ...
|
||||
def get_internal_type(self): ...
|
||||
def get_internal_type(self) -> str: ...
|
||||
def formfield(self, **kwargs: Any): ...
|
||||
|
||||
class SlugField(CharField):
|
||||
@@ -431,20 +586,34 @@ class SlugField(CharField):
|
||||
allow_unicode: bool = ...,
|
||||
**kwargs: Any
|
||||
) -> None: ...
|
||||
def deconstruct(self): ...
|
||||
def get_internal_type(self): ...
|
||||
def formfield(self, **kwargs: Any): ...
|
||||
def deconstruct(
|
||||
self
|
||||
) -> 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):
|
||||
description: Any = ...
|
||||
def get_internal_type(self): ...
|
||||
def get_internal_type(self) -> str: ...
|
||||
|
||||
class TextField(Field):
|
||||
description: Any = ...
|
||||
def get_internal_type(self): ...
|
||||
def to_python(self, value: Any): ...
|
||||
def get_prep_value(self, value: Any): ...
|
||||
def formfield(self, **kwargs: Any): ...
|
||||
def get_internal_type(self) -> str: ...
|
||||
def to_python(
|
||||
self, value: Optional[Union[Dict[Any, Any], int, str]]
|
||||
) -> 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):
|
||||
empty_strings_allowed: bool = ...
|
||||
@@ -452,20 +621,31 @@ class TimeField(DateTimeCheckMixin, Field):
|
||||
description: Any = ...
|
||||
def __init__(
|
||||
self,
|
||||
verbose_name: Optional[Any] = ...,
|
||||
name: Optional[Any] = ...,
|
||||
verbose_name: None = ...,
|
||||
name: None = ...,
|
||||
auto_now: bool = ...,
|
||||
auto_now_add: bool = ...,
|
||||
**kwargs: Any
|
||||
) -> None: ...
|
||||
def deconstruct(self): ...
|
||||
def get_internal_type(self): ...
|
||||
def to_python(self, value: Any): ...
|
||||
def pre_save(self, model_instance: Any, add: Any): ...
|
||||
def get_prep_value(self, value: Any): ...
|
||||
def deconstruct(
|
||||
self
|
||||
) -> Tuple[str, List[Any], Dict[Any, Any], Dict[Any, Any]]: ...
|
||||
def get_internal_type(self) -> str: ...
|
||||
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(
|
||||
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 formfield(self, **kwargs: Any): ...
|
||||
|
||||
@@ -473,25 +653,44 @@ class URLField(CharField):
|
||||
default_validators: Any = ...
|
||||
description: Any = ...
|
||||
def __init__(
|
||||
self,
|
||||
verbose_name: Optional[Any] = ...,
|
||||
name: Optional[Any] = ...,
|
||||
**kwargs: Any
|
||||
self, verbose_name: None = ..., name: None = ..., **kwargs: Any
|
||||
) -> None: ...
|
||||
def deconstruct(self): ...
|
||||
def formfield(self, **kwargs: Any): ...
|
||||
def deconstruct(
|
||||
self
|
||||
) -> Tuple[
|
||||
str, List[Any], Dict[str, int], Union[Dict[Any, Any], Dict[str, int]]
|
||||
]: ...
|
||||
def formfield(self, **kwargs: Any) -> URLField: ...
|
||||
|
||||
class BinaryField(Field):
|
||||
description: Any = ...
|
||||
empty_values: Any = ...
|
||||
def __init__(self, *args: Any, **kwargs: Any) -> None: ...
|
||||
def deconstruct(self): ...
|
||||
def get_internal_type(self): ...
|
||||
def get_placeholder(self, value: Any, compiler: Any, connection: Any): ...
|
||||
def get_default(self): ...
|
||||
def deconstruct(
|
||||
self
|
||||
) -> Union[
|
||||
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(
|
||||
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 to_python(self, value: Any): ...
|
||||
|
||||
@@ -499,13 +698,23 @@ class UUIDField(Field):
|
||||
default_error_messages: Any = ...
|
||||
description: str = ...
|
||||
empty_strings_allowed: bool = ...
|
||||
def __init__(
|
||||
self, verbose_name: Optional[Any] = ..., **kwargs: Any
|
||||
) -> None: ...
|
||||
def deconstruct(self): ...
|
||||
def get_internal_type(self): ...
|
||||
def __init__(self, verbose_name: None = ..., **kwargs: Any) -> None: ...
|
||||
def deconstruct(
|
||||
self
|
||||
) -> Tuple[
|
||||
str,
|
||||
List[Any],
|
||||
Dict[str, Union[Callable, bool]],
|
||||
Dict[str, Union[Callable, bool]],
|
||||
]: ...
|
||||
def get_internal_type(self) -> str: ...
|
||||
def get_db_prep_value(
|
||||
self, value: Any, connection: Any, prepared: bool = ...
|
||||
): ...
|
||||
def to_python(self, value: Any): ...
|
||||
def formfield(self, **kwargs: Any): ...
|
||||
self,
|
||||
value: Optional[Union[Dict[Any, Any], List[Any]]],
|
||||
connection: DatabaseWrapper,
|
||||
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 django.core.checks.messages import Error
|
||||
@@ -20,12 +19,7 @@ class FieldFile(File):
|
||||
def __init__(
|
||||
self, instance: Model, field: FileField, name: Optional[str]
|
||||
) -> None: ...
|
||||
def __eq__(
|
||||
self,
|
||||
other: Optional[
|
||||
Union[Dict[Any, Any], List[Any], Tuple, FieldFile, str]
|
||||
],
|
||||
) -> bool: ...
|
||||
def __eq__(self, other: Any) -> bool: ...
|
||||
def __hash__(self): ...
|
||||
file: Any = ...
|
||||
@property
|
||||
@@ -69,36 +63,16 @@ class FileField(Field):
|
||||
def check(self, **kwargs: Any) -> List[Error]: ...
|
||||
def deconstruct(
|
||||
self
|
||||
) -> Union[
|
||||
Tuple[
|
||||
None,
|
||||
str,
|
||||
List[Any],
|
||||
Union[
|
||||
Dict[str, Union[Callable, FileSystemStorage]],
|
||||
Dict[str, Union[partial, int]],
|
||||
],
|
||||
) -> Tuple[
|
||||
str,
|
||||
List[Any],
|
||||
Union[
|
||||
Dict[str, Union[Callable, FileSystemStorage, int]],
|
||||
Dict[str, Union[FileSystemStorage, int, str]],
|
||||
],
|
||||
Tuple[
|
||||
str,
|
||||
List[Any],
|
||||
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],
|
||||
],
|
||||
Union[
|
||||
Dict[str, Union[Callable, FileSystemStorage, int]],
|
||||
Dict[str, Union[FileSystemStorage, int, str]],
|
||||
],
|
||||
]: ...
|
||||
def get_internal_type(self) -> str: ...
|
||||
@@ -141,16 +115,11 @@ class ImageField(FileField):
|
||||
def check(self, **kwargs: Any) -> List[Any]: ...
|
||||
def deconstruct(
|
||||
self
|
||||
) -> Union[
|
||||
Tuple[
|
||||
str,
|
||||
List[Any],
|
||||
Dict[str, Union[Callable, bool, FileSystemStorage, str]],
|
||||
Dict[str, Union[Callable, bool, FileSystemStorage, str]],
|
||||
],
|
||||
Tuple[
|
||||
str, str, List[Any], Dict[str, Union[Callable, FileSystemStorage]]
|
||||
],
|
||||
) -> Tuple[
|
||||
str,
|
||||
List[Any],
|
||||
Dict[str, Union[Callable, bool, FileSystemStorage, str]],
|
||||
Dict[str, Union[Callable, bool, FileSystemStorage, str]],
|
||||
]: ...
|
||||
def contribute_to_class(
|
||||
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.db.backends.sqlite3.base import DatabaseWrapper
|
||||
from django.db.migrations.writer import SettingsReference
|
||||
from django.db.models.base import Model
|
||||
from django.db.models.expressions import Col
|
||||
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,
|
||||
ManyToManyRel,
|
||||
ManyToOneRel)
|
||||
from django.db.models.lookups import Exact
|
||||
ManyToOneRel, OneToOneRel)
|
||||
from django.db.models.query import QuerySet
|
||||
from django.db.models.query_utils import PathInfo, Q
|
||||
from django.db.models.sql.where import WhereNode
|
||||
@@ -63,27 +57,18 @@ class RelatedField(FieldCacheMixin, Field):
|
||||
) -> None: ...
|
||||
def deconstruct(
|
||||
self
|
||||
) -> Union[
|
||||
Tuple[
|
||||
str,
|
||||
List[Any],
|
||||
) -> Tuple[
|
||||
str,
|
||||
List[Any],
|
||||
Union[
|
||||
Dict[str, Union[Callable, bool, str]],
|
||||
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]],
|
||||
],
|
||||
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]]
|
||||
Dict[str, Union[Dict[str, bool], bool, str]],
|
||||
],
|
||||
]: ...
|
||||
def get_forward_related_filter(
|
||||
@@ -135,40 +120,19 @@ class ForeignObject(RelatedField):
|
||||
def deconstruct(
|
||||
self
|
||||
) -> Union[
|
||||
Tuple[None, str, List[Any], Dict[str, Any]],
|
||||
Tuple[str, List[Any], Dict[str, Any], Dict[str, Any]],
|
||||
Tuple[
|
||||
None,
|
||||
str,
|
||||
str,
|
||||
List[Any],
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
Callable,
|
||||
Dict[str, Union[int, str]],
|
||||
List[None],
|
||||
List[str],
|
||||
bool,
|
||||
str,
|
||||
Callable, Dict[str, Union[int, str]], 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]]: ...
|
||||
@property
|
||||
@@ -205,22 +169,7 @@ class ForeignObject(RelatedField):
|
||||
) -> List[PathInfo]: ...
|
||||
def get_reverse_path_info(self, filtered_relation: Optional[Any] = ...): ...
|
||||
@classmethod
|
||||
def get_lookups(
|
||||
cls
|
||||
) -> Dict[
|
||||
str,
|
||||
Type[
|
||||
Union[
|
||||
RelatedGreaterThan,
|
||||
RelatedGreaterThanOrEqual,
|
||||
RelatedIn,
|
||||
RelatedIsNull,
|
||||
RelatedLessThan,
|
||||
RelatedLessThanOrEqual,
|
||||
Exact,
|
||||
]
|
||||
],
|
||||
]: ...
|
||||
def get_lookups(cls) -> Dict[str, Type[Any]]: ...
|
||||
def contribute_to_class(
|
||||
self,
|
||||
cls: Type[Model],
|
||||
@@ -261,23 +210,31 @@ class ForeignKey(ForeignObject):
|
||||
self
|
||||
) -> Union[
|
||||
Tuple[
|
||||
None,
|
||||
str,
|
||||
List[Any],
|
||||
Dict[str, Union[Callable, Dict[str, Union[int, str]], str]],
|
||||
Dict[str, Union[Callable, Dict[str, Union[int, str]], str]],
|
||||
],
|
||||
Tuple[
|
||||
str,
|
||||
List[Any],
|
||||
Union[
|
||||
Dict[str, Union[Callable, Dict[str, Union[int, str]], str]],
|
||||
Dict[str, Union[Callable, Dict[str, bool], str]],
|
||||
Dict[str, Union[Callable, bool, str]],
|
||||
],
|
||||
Union[
|
||||
Dict[str, Union[Callable, Dict[str, Union[int, str]], str]],
|
||||
Dict[str, Union[Callable, Dict[str, 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: ...
|
||||
@property
|
||||
@@ -320,7 +277,7 @@ class ForeignKey(ForeignObject):
|
||||
def get_col(
|
||||
self,
|
||||
alias: str,
|
||||
output_field: Optional[Union[Field, mixins.FieldCacheMixin]] = ...,
|
||||
output_field: Optional[Union[Field, OneToOneRel]] = ...,
|
||||
) -> Col: ...
|
||||
|
||||
class OneToOneField(ForeignKey):
|
||||
@@ -341,14 +298,11 @@ class OneToOneField(ForeignKey):
|
||||
) -> None: ...
|
||||
def deconstruct(
|
||||
self
|
||||
) -> Union[
|
||||
Tuple[
|
||||
str,
|
||||
List[Any],
|
||||
Dict[str, Union[Callable, bool, str]],
|
||||
Dict[str, Union[Callable, bool, str]],
|
||||
],
|
||||
Tuple[str, str, List[Any], Dict[str, Union[Callable, str]]],
|
||||
) -> Tuple[
|
||||
str,
|
||||
List[Any],
|
||||
Dict[str, Union[Callable, bool, str]],
|
||||
Dict[str, Union[Callable, bool, str]],
|
||||
]: ...
|
||||
def formfield(self, **kwargs: Any) -> None: ...
|
||||
def save_form_data(
|
||||
@@ -385,18 +339,18 @@ class ManyToManyField(RelatedField):
|
||||
def deconstruct(
|
||||
self
|
||||
) -> Union[
|
||||
Tuple[None, str, List[Any], Dict[str, Union[bool, str]]],
|
||||
Tuple[
|
||||
str,
|
||||
List[Any],
|
||||
Dict[str, Union[Callable, str]],
|
||||
Dict[str, Union[Callable, str]],
|
||||
],
|
||||
Tuple[
|
||||
str,
|
||||
List[Any],
|
||||
Dict[str, Union[bool, str]],
|
||||
Dict[str, Union[bool, str]],
|
||||
Union[Dict[str, Union[Callable, str]], Dict[str, Union[bool, str]]],
|
||||
Union[
|
||||
Dict[str, Union[Callable, str]],
|
||||
Dict[str, Union[bool, str]],
|
||||
Dict[str, str],
|
||||
],
|
||||
],
|
||||
Tuple[str, str, List[Any], Dict[str, Union[Callable, str]]],
|
||||
]: ...
|
||||
def get_path_info(
|
||||
self, filtered_relation: None = ...
|
||||
|
||||
@@ -4,7 +4,7 @@ from uuid import UUID
|
||||
|
||||
from django.db.backends.sqlite3.base import DatabaseWrapper
|
||||
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.related import ForeignObject
|
||||
from django.db.models.lookups import (Exact, GreaterThan, GreaterThanOrEqual,
|
||||
@@ -33,10 +33,7 @@ class MultiColSource:
|
||||
) -> Type[Union[RelatedExact, RelatedIn, RelatedIsNull]]: ...
|
||||
|
||||
def get_normalized_value(
|
||||
value: Optional[
|
||||
Union[Tuple[Union[int, str]], Model, OuterRef, int, str, UUID]
|
||||
],
|
||||
lhs: Union[Col, MultiColSource],
|
||||
value: Any, lhs: Union[Col, MultiColSource]
|
||||
) -> Tuple[Optional[Union[OuterRef, int, str, UUID]]]: ...
|
||||
|
||||
class RelatedIn(In):
|
||||
@@ -65,9 +62,7 @@ class RelatedIn(In):
|
||||
|
||||
class RelatedLookupMixin:
|
||||
rhs: Any = ...
|
||||
def get_prep_lookup(
|
||||
self
|
||||
) -> Optional[Union[Model, Combinable, Query, int, str, UUID]]: ...
|
||||
def get_prep_lookup(self) -> Any: ...
|
||||
def as_sql(
|
||||
self, compiler: SQLCompiler, connection: DatabaseWrapper
|
||||
) -> 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.models import Func, Transform
|
||||
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.query import Query
|
||||
|
||||
@@ -138,7 +138,7 @@ class TruncBase(TimezoneMixin, Transform):
|
||||
def __init__(
|
||||
self,
|
||||
expression: Union[Col, str],
|
||||
output_field: Optional[Field] = ...,
|
||||
output_field: Optional[Union[DateTimeCheckMixin, IntegerField]] = ...,
|
||||
tzinfo: None = ...,
|
||||
**extra: Any
|
||||
) -> None: ...
|
||||
@@ -164,10 +164,7 @@ class Trunc(TruncBase):
|
||||
contains_aggregate: bool
|
||||
extra: Dict[Any, Any]
|
||||
is_summary: bool
|
||||
output_field: Union[
|
||||
django.db.models.fields.DateTimeCheckMixin,
|
||||
django.db.models.fields.IntegerField,
|
||||
]
|
||||
output_field: django.db.models.fields.Field
|
||||
source_expressions: List[django.db.models.expressions.Combinable]
|
||||
tzinfo: None
|
||||
kind: str = ...
|
||||
@@ -175,7 +172,7 @@ class Trunc(TruncBase):
|
||||
self,
|
||||
expression: str,
|
||||
kind: str,
|
||||
output_field: Optional[Field] = ...,
|
||||
output_field: Optional[Union[DateTimeCheckMixin, IntegerField]] = ...,
|
||||
tzinfo: None = ...,
|
||||
**extra: Any
|
||||
) -> None: ...
|
||||
|
||||
@@ -36,12 +36,7 @@ class ConcatPair(Func):
|
||||
extra: Dict[Any, Any]
|
||||
is_summary: bool
|
||||
output_field: django.db.models.fields.CharField
|
||||
source_expressions: List[
|
||||
Union[
|
||||
django.db.models.expressions.Expression,
|
||||
django.db.models.expressions.F,
|
||||
]
|
||||
]
|
||||
source_expressions: List[django.db.models.expressions.Combinable]
|
||||
function: str = ...
|
||||
def as_sqlite(
|
||||
self, compiler: SQLCompiler, connection: DatabaseWrapper
|
||||
@@ -157,12 +152,7 @@ class Repeat(BytesToCharFieldConversionMixin, Func):
|
||||
extra: Dict[Any, Any]
|
||||
is_summary: bool
|
||||
output_field: django.db.models.fields.CharField
|
||||
source_expressions: List[
|
||||
Union[
|
||||
django.db.models.expressions.Expression,
|
||||
django.db.models.expressions.F,
|
||||
]
|
||||
]
|
||||
source_expressions: List[django.db.models.expressions.Combinable]
|
||||
function: str = ...
|
||||
def __init__(
|
||||
self,
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
from datetime import date, datetime, timedelta
|
||||
from datetime import date, datetime
|
||||
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 django.contrib.contenttypes.models import ContentType
|
||||
from django.db.backends.sqlite3.base import DatabaseWrapper
|
||||
from django.db.models.base import Model
|
||||
from django.db.models.expressions import (Col, Combinable, CombinedExpression,
|
||||
Expression, F, Func, Ref, Subquery)
|
||||
from django.db.models.expressions import (Col, Combinable, Expression, Func,
|
||||
Ref, Subquery)
|
||||
from django.db.models.fields import TextField
|
||||
from django.db.models.fields.related_lookups import MultiColSource
|
||||
from django.db.models.query_utils import RegisterLookupMixin
|
||||
@@ -23,37 +22,7 @@ class Lookup:
|
||||
rhs: Any = ...
|
||||
bilateral_transforms: Any = ...
|
||||
def __init__(
|
||||
self,
|
||||
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,
|
||||
]
|
||||
],
|
||||
self, lhs: Union[Expression, TextField, MultiColSource], rhs: Any
|
||||
) -> None: ...
|
||||
def apply_bilateral_transforms(self, value: Expression) -> Transform: ...
|
||||
def batch_process_rhs(
|
||||
@@ -68,25 +37,7 @@ class Lookup:
|
||||
def get_source_expressions(self) -> List[Expression]: ...
|
||||
lhs: Any = ...
|
||||
def set_source_expressions(self, new_exprs: List[Ref]) -> None: ...
|
||||
def get_prep_lookup(
|
||||
self
|
||||
) -> Optional[
|
||||
Union[
|
||||
Dict[Any, Any],
|
||||
List[Any],
|
||||
bytes,
|
||||
date,
|
||||
timedelta,
|
||||
Decimal,
|
||||
Model,
|
||||
Combinable,
|
||||
Query,
|
||||
float,
|
||||
int,
|
||||
str,
|
||||
UUID,
|
||||
]
|
||||
]: ...
|
||||
def get_prep_lookup(self) -> Any: ...
|
||||
def get_db_prep_lookup(
|
||||
self, value: Union[int, str], connection: DatabaseWrapper
|
||||
) -> Tuple[str, Union[List[int], List[str]]]: ...
|
||||
@@ -143,8 +94,8 @@ class BuiltinLookup(Lookup):
|
||||
List[Optional[int]],
|
||||
List[Union[date, str]],
|
||||
List[Union[Decimal, int]],
|
||||
List[Union[float, int]],
|
||||
List[Union[int, str]],
|
||||
List[float],
|
||||
List[memoryview],
|
||||
],
|
||||
]: ...
|
||||
@@ -153,29 +104,12 @@ class BuiltinLookup(Lookup):
|
||||
class FieldGetDbPrepValueMixin:
|
||||
get_db_prep_lookup_value_is_iterable: bool = ...
|
||||
def get_db_prep_lookup(
|
||||
self,
|
||||
value: Union[
|
||||
Dict[Any, Any],
|
||||
List[Union[Combinable, int]],
|
||||
List[datetime],
|
||||
bytes,
|
||||
date,
|
||||
timedelta,
|
||||
Decimal,
|
||||
OrderedSet,
|
||||
float,
|
||||
int,
|
||||
str,
|
||||
UUID,
|
||||
],
|
||||
connection: DatabaseWrapper,
|
||||
self, value: Any, connection: DatabaseWrapper
|
||||
) -> Tuple[
|
||||
str,
|
||||
Union[
|
||||
List[Optional[int]],
|
||||
List[Union[CombinedExpression, F]],
|
||||
List[Union[CombinedExpression, int]],
|
||||
List[Union[F, int]],
|
||||
List[Union[Combinable, int]],
|
||||
List[Decimal],
|
||||
List[float],
|
||||
List[memoryview],
|
||||
@@ -219,23 +153,7 @@ class Exact(FieldGetDbPrepValueMixin, BuiltinLookup):
|
||||
contains_aggregate: bool
|
||||
contains_over_clause: bool
|
||||
lhs: django.db.models.expressions.Expression
|
||||
rhs: Optional[
|
||||
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,
|
||||
]
|
||||
]
|
||||
rhs: Any
|
||||
lookup_name: str = ...
|
||||
def process_rhs(
|
||||
self, compiler: SQLCompiler, connection: DatabaseWrapper
|
||||
@@ -265,62 +183,40 @@ class IExact(BuiltinLookup):
|
||||
class GreaterThan(FieldGetDbPrepValueMixin, BuiltinLookup):
|
||||
bilateral_transforms: List[Any]
|
||||
contains_aggregate: bool
|
||||
lhs: django.db.models.expressions.Expression
|
||||
rhs: Optional[
|
||||
Union[
|
||||
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,
|
||||
]
|
||||
lhs: Union[
|
||||
django.db.models.expressions.Expression,
|
||||
django.db.models.expressions.SQLiteNumericMixin,
|
||||
]
|
||||
rhs: Any
|
||||
lookup_name: str = ...
|
||||
|
||||
class GreaterThanOrEqual(FieldGetDbPrepValueMixin, BuiltinLookup):
|
||||
bilateral_transforms: List[Any]
|
||||
contains_aggregate: bool
|
||||
lhs: django.db.models.expressions.Expression
|
||||
rhs: Union[
|
||||
datetime.date,
|
||||
datetime.timedelta,
|
||||
decimal.Decimal,
|
||||
django.db.models.expressions.Combinable,
|
||||
int,
|
||||
str,
|
||||
]
|
||||
rhs: Any
|
||||
lookup_name: str = ...
|
||||
|
||||
class LessThan(FieldGetDbPrepValueMixin, BuiltinLookup):
|
||||
bilateral_transforms: List[Any]
|
||||
contains_aggregate: bool
|
||||
lhs: django.db.models.expressions.Expression
|
||||
rhs: Union[
|
||||
datetime.date,
|
||||
datetime.timedelta,
|
||||
decimal.Decimal,
|
||||
django.db.models.expressions.CombinedExpression,
|
||||
float,
|
||||
int,
|
||||
str,
|
||||
]
|
||||
rhs: Any
|
||||
lookup_name: str = ...
|
||||
|
||||
class LessThanOrEqual(FieldGetDbPrepValueMixin, BuiltinLookup):
|
||||
bilateral_transforms: List[Type[django.db.models.lookups.Transform]]
|
||||
contains_aggregate: 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[
|
||||
datetime.date,
|
||||
decimal.Decimal,
|
||||
django.db.models.expressions.Expression,
|
||||
float,
|
||||
int,
|
||||
]
|
||||
lookup_name: str = ...
|
||||
|
||||
@@ -337,20 +233,7 @@ class In(FieldGetDbPrepValueIterableMixin, BuiltinLookup):
|
||||
bilateral_transforms: List[Type[django.db.models.lookups.Transform]]
|
||||
contains_aggregate: bool
|
||||
lhs: django.db.models.expressions.Expression
|
||||
rhs: Union[
|
||||
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,
|
||||
]
|
||||
rhs: Any
|
||||
lookup_name: str = ...
|
||||
def process_rhs(
|
||||
self, compiler: SQLCompiler, connection: DatabaseWrapper
|
||||
@@ -421,7 +304,7 @@ class Range(FieldGetDbPrepValueIterableMixin, BuiltinLookup):
|
||||
List[Union[django.db.models.expressions.Combinable, int]],
|
||||
List[datetime.datetime],
|
||||
Tuple[
|
||||
Union[django.db.models.expressions.CombinedExpression, int],
|
||||
Union[django.db.models.expressions.Combinable, int],
|
||||
Union[django.db.models.expressions.CombinedExpression, int],
|
||||
],
|
||||
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.models import AbstractUser, PermissionsMixin
|
||||
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.db.backends.sqlite3.base import DatabaseWrapper
|
||||
from django.db.models.base import Model
|
||||
@@ -22,27 +24,17 @@ IMMUTABLE_WARNING: str
|
||||
DEFAULT_NAMES: Any
|
||||
|
||||
def normalize_together(
|
||||
option_together: Optional[
|
||||
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,
|
||||
]
|
||||
]
|
||||
option_together: Any
|
||||
) -> Union[
|
||||
List[Union[Tuple[str, str], int]],
|
||||
Set[Union[Tuple[str, str, str, str], Tuple[str, str]]],
|
||||
Tuple,
|
||||
int,
|
||||
str,
|
||||
List[Union[Tuple[str, str], int]], Set[Tuple[str, str]], Tuple, int, str
|
||||
]: ...
|
||||
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: ...
|
||||
|
||||
class Options:
|
||||
@@ -57,11 +49,7 @@ class Options:
|
||||
FORWARD_PROPERTIES: Any = ...
|
||||
REVERSE_PROPERTIES: Any = ...
|
||||
default_apps: Any = ...
|
||||
local_fields: List[
|
||||
Union[
|
||||
django.db.models.fields.AutoField, django.db.models.fields.CharField
|
||||
]
|
||||
] = ...
|
||||
local_fields: List[django.db.models.fields.Field] = ...
|
||||
local_many_to_many: List[
|
||||
django.db.models.fields.related.ManyToManyField
|
||||
] = ...
|
||||
@@ -90,7 +78,6 @@ class Options:
|
||||
meta: Optional[
|
||||
Type[
|
||||
Union[
|
||||
Any,
|
||||
django.contrib.auth.base_user.AbstractBaseUser.Meta,
|
||||
django.contrib.auth.models.AbstractUser.Meta,
|
||||
django.contrib.auth.models.PermissionsMixin.Meta,
|
||||
@@ -116,7 +103,6 @@ class Options:
|
||||
meta: Optional[
|
||||
Type[
|
||||
Union[
|
||||
Any,
|
||||
AbstractBaseUser.Meta,
|
||||
AbstractUser.Meta,
|
||||
PermissionsMixin.Meta,
|
||||
@@ -163,7 +149,7 @@ class Options:
|
||||
def fields_map(self) -> Dict[str, ForeignObjectRel]: ...
|
||||
def get_field(
|
||||
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_parent_list(self) -> List[Type[Model]]: ...
|
||||
def get_ancestor_link(
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,4 @@
|
||||
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 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.fields import Field
|
||||
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.sql.compiler import SQLCompiler
|
||||
from django.db.models.sql.query import Query
|
||||
@@ -37,89 +36,7 @@ class QueryWrapper:
|
||||
class Q(tree.Node):
|
||||
children: Union[
|
||||
List[Dict[str, str]],
|
||||
List[
|
||||
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,
|
||||
]
|
||||
],
|
||||
List[Union[Tuple[str, Any], django.db.models.query_utils.Q]],
|
||||
]
|
||||
connector: str
|
||||
negated: bool
|
||||
@@ -150,7 +67,7 @@ class DeferredAttribute:
|
||||
def __init__(self, field_name: str) -> None: ...
|
||||
def __get__(
|
||||
self, instance: Optional[Model], cls: Type[Model] = ...
|
||||
) -> Optional[Union[date, Decimal, DeferredAttribute, float, int, str]]: ...
|
||||
) -> Any: ...
|
||||
|
||||
class RegisterLookupMixin:
|
||||
@classmethod
|
||||
@@ -159,7 +76,10 @@ class RegisterLookupMixin:
|
||||
def get_transform(self, lookup_name: str) -> Optional[Type[Transform]]: ...
|
||||
@staticmethod
|
||||
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]]]: ...
|
||||
@classmethod
|
||||
def register_lookup(
|
||||
@@ -193,10 +113,8 @@ def select_related_descend(
|
||||
) -> bool: ...
|
||||
def refs_expression(
|
||||
lookup_parts: List[str], annotations: OrderedDict
|
||||
) -> Union[
|
||||
Tuple[List[str], List[str]],
|
||||
Tuple[bool, Tuple],
|
||||
Tuple[Expression, List[Any]],
|
||||
) -> Tuple[
|
||||
Union[List[str], Tuple, Expression], Union[List[Any], List[str], Tuple]
|
||||
]: ...
|
||||
def check_rel_lookup_compatibility(
|
||||
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)
|
||||
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.utils import CursorWrapper
|
||||
from django.db.models.base import Model
|
||||
from django.db.models.expressions import (BaseExpression, Col, Combinable,
|
||||
Expression, OrderBy, RawSQL,
|
||||
SQLiteNumericMixin)
|
||||
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.expressions import (BaseExpression, Col, Expression,
|
||||
OrderBy, SQLiteNumericMixin)
|
||||
from django.db.models.fields import DateTimeCheckMixin, Field
|
||||
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.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.where import (ExtraWhere, NothingNode,
|
||||
SubqueryConstraint, WhereNode)
|
||||
from django.utils.datastructures import ImmutableList
|
||||
|
||||
FORCE: Any
|
||||
@@ -50,46 +38,29 @@ class SQLCompiler:
|
||||
has_extra_select: Any = ...
|
||||
def pre_sql_setup(
|
||||
self
|
||||
) -> Union[
|
||||
Tuple[
|
||||
List[Any],
|
||||
List[Any],
|
||||
List[Union[Tuple[str, List[Any]], Tuple[str, List[str]]]],
|
||||
) -> Tuple[
|
||||
Union[
|
||||
List[Tuple[OrderBy, Tuple[str, Tuple[str, str], bool]]],
|
||||
List[Tuple[str, List[int]]],
|
||||
List[Tuple[str, Union[List[float], List[str]]]],
|
||||
],
|
||||
Tuple[
|
||||
List[Any],
|
||||
List[
|
||||
Tuple[
|
||||
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]]]]
|
||||
],
|
||||
Union[
|
||||
List[Tuple[OrderBy, Tuple[str, List[Any], bool]]],
|
||||
List[Tuple[str, List[int]]],
|
||||
List[Tuple[str, Union[List[float], List[str]]]],
|
||||
],
|
||||
Tuple[
|
||||
List[Tuple[OrderBy, None, None]],
|
||||
List[
|
||||
Tuple[
|
||||
OrderBy,
|
||||
Union[
|
||||
Tuple[str, List[Union[int, str]], bool],
|
||||
Tuple[str, Tuple[str, str], bool],
|
||||
],
|
||||
]
|
||||
],
|
||||
List[Union[Any, Tuple[str, List[int]]]],
|
||||
Union[
|
||||
List[Any],
|
||||
List[Tuple[str, List[int]]],
|
||||
List[Tuple[str, Union[List[float], List[str]]]],
|
||||
],
|
||||
]: ...
|
||||
def get_group_by(
|
||||
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[
|
||||
Tuple[
|
||||
OrderBy,
|
||||
@@ -103,9 +74,7 @@ class SQLCompiler:
|
||||
],
|
||||
]
|
||||
],
|
||||
) -> List[
|
||||
Tuple[str, Union[List[Any], List[float], List[int], List[str]]]
|
||||
]: ...
|
||||
) -> List[Tuple[str, Union[List[float], List[int], List[str]]]]: ...
|
||||
def collapse_group_by(
|
||||
self,
|
||||
expressions: List[Expression],
|
||||
@@ -113,202 +82,10 @@ class SQLCompiler:
|
||||
) -> List[Expression]: ...
|
||||
def get_select(
|
||||
self
|
||||
) -> Union[
|
||||
Tuple[
|
||||
List[Tuple[Col, Tuple[str, List[Any]], None]],
|
||||
Dict[
|
||||
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]],
|
||||
) -> Tuple[
|
||||
Optional[Dict[str, int]],
|
||||
Union[Dict[Any, Any], Dict[str, int]],
|
||||
Union[Dict[Any, Any], Dict[str, int]],
|
||||
]: ...
|
||||
def get_order_by(
|
||||
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]]: ...
|
||||
def quote_name_unless_alias(self, name: str) -> str: ...
|
||||
def compile(
|
||||
self,
|
||||
node: Union[
|
||||
Combinable,
|
||||
OrderBy,
|
||||
Lookup,
|
||||
FilteredRelation,
|
||||
QueryWrapper,
|
||||
BaseTable,
|
||||
Join,
|
||||
Query,
|
||||
ExtraWhere,
|
||||
NothingNode,
|
||||
SubqueryConstraint,
|
||||
WhereNode,
|
||||
],
|
||||
select_format: Any = ...,
|
||||
self, node: Any, select_format: Any = ...
|
||||
) -> Tuple[
|
||||
str,
|
||||
Union[
|
||||
@@ -365,9 +130,9 @@ class SQLCompiler:
|
||||
List[Union[date, int]],
|
||||
List[Union[date, str]],
|
||||
List[Union[Decimal, int]],
|
||||
List[Union[float, int]],
|
||||
List[Union[int, memoryview]],
|
||||
List[Union[int, str]],
|
||||
List[float],
|
||||
Tuple,
|
||||
],
|
||||
]: ...
|
||||
@@ -393,12 +158,7 @@ class SQLCompiler:
|
||||
already_seen: Optional[
|
||||
Union[
|
||||
Set[
|
||||
Tuple[
|
||||
None,
|
||||
Tuple[Tuple[str, str]],
|
||||
Tuple[Tuple[str, str]],
|
||||
Tuple[Tuple[str, str]],
|
||||
]
|
||||
Tuple[None, 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]
|
||||
] = ...,
|
||||
restricted: Optional[bool] = ...,
|
||||
) -> Union[
|
||||
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,
|
||||
],
|
||||
],
|
||||
]
|
||||
],
|
||||
]: ...
|
||||
) -> List[Dict[str, Any]]: ...
|
||||
def get_select_for_update_of_arguments(self): ...
|
||||
def deferred_to_columns(
|
||||
self
|
||||
) -> Dict[Type[Model], Union[Set[Any], Set[str]]]: ...
|
||||
def deferred_to_columns(self) -> Dict[Type[Model], Set[str]]: ...
|
||||
def get_converters(
|
||||
self, expressions: List[Optional[Expression]]
|
||||
) -> Dict[int, Tuple[List[Callable], Expression]]: ...
|
||||
self,
|
||||
expressions: Union[
|
||||
List[Optional[Expression]], List[SQLiteNumericMixin]
|
||||
],
|
||||
) -> Dict[
|
||||
int, Tuple[List[Callable], Union[Expression, SQLiteNumericMixin]]
|
||||
]: ...
|
||||
def apply_converters(
|
||||
self,
|
||||
rows: chain,
|
||||
converters: Dict[int, Tuple[List[Callable], Expression]],
|
||||
converters: Dict[
|
||||
int, Tuple[List[Callable], Union[Expression, SQLiteNumericMixin]]
|
||||
],
|
||||
) -> Iterator[
|
||||
Union[
|
||||
List[Optional[Union[bool, datetime, str, UUID]]],
|
||||
@@ -734,10 +199,10 @@ class SQLCompiler:
|
||||
List[Optional[Union[bytes, time, int, str]]],
|
||||
List[Optional[Union[bytes, timedelta, 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[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[datetime, time, Decimal, int, str]],
|
||||
List[Union[timedelta, Decimal, int, str]],
|
||||
@@ -748,49 +213,7 @@ class SQLCompiler:
|
||||
self,
|
||||
results: Optional[
|
||||
Union[
|
||||
Iterator[Any],
|
||||
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]]
|
||||
],
|
||||
]
|
||||
],
|
||||
Iterator[Any], List[List[Tuple[Union[date, float, int, str]]]]
|
||||
]
|
||||
] = ...,
|
||||
tuple_expected: bool = ...,
|
||||
@@ -814,67 +237,50 @@ class SQLInsertCompiler(SQLCompiler):
|
||||
def field_as_sql(
|
||||
self,
|
||||
field: Optional[Field],
|
||||
val: Optional[Union[Lower, float, int, memoryview, str]],
|
||||
val: Optional[Union[Lower, float, memoryview, str]],
|
||||
) -> Tuple[
|
||||
str,
|
||||
Union[List[None], List[float], List[int], List[memoryview], List[str]],
|
||||
]: ...
|
||||
def prepare_value(
|
||||
self,
|
||||
field: Field,
|
||||
value: Optional[
|
||||
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,
|
||||
]
|
||||
]: ...
|
||||
self, field: Field, value: Any
|
||||
) -> Optional[Union[Lower, float, memoryview, str]]: ...
|
||||
def pre_save_val(self, field: Field, obj: Model) -> Any: ...
|
||||
def assemble_as_sql(
|
||||
self,
|
||||
fields: Union[List[None], List[Field], ImmutableList],
|
||||
value_rows: List[
|
||||
Union[
|
||||
List[Optional[Union[Lower, int]]],
|
||||
List[Optional[Union[float, int, memoryview, str]]],
|
||||
]
|
||||
fields: Union[
|
||||
List[None], List[DateTimeCheckMixin], List[Field], ImmutableList
|
||||
],
|
||||
) -> Union[
|
||||
Tuple[List[Any], List[Any]],
|
||||
Tuple[
|
||||
value_rows: Union[
|
||||
List[
|
||||
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]],
|
||||
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(
|
||||
@@ -886,21 +292,13 @@ class SQLInsertCompiler(SQLCompiler):
|
||||
List[Any],
|
||||
List[None],
|
||||
List[Optional[Union[bool, str]]],
|
||||
List[Optional[Union[bool, str]]],
|
||||
List[Optional[Union[float, int, str]]],
|
||||
List[Optional[Union[float, str]]],
|
||||
List[Optional[Union[int, memoryview, str]]],
|
||||
List[Optional[Union[int, str]]],
|
||||
List[Optional[Union[int, str]]],
|
||||
List[Optional[Union[int, str]]],
|
||||
List[Optional[bool]],
|
||||
List[Optional[int]],
|
||||
List[Optional[int]],
|
||||
List[Optional[str]],
|
||||
List[Optional[str]],
|
||||
List[Union[bool, str]],
|
||||
List[Union[float, int, str]],
|
||||
List[Union[float, int]],
|
||||
List[Union[float, str]],
|
||||
List[Union[float, str]],
|
||||
List[Union[int, str]],
|
||||
List[bool],
|
||||
@@ -931,4 +329,4 @@ def cursor_iter(
|
||||
sentinel: List[Any],
|
||||
col_count: Optional[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 datetime import date, datetime, time, timedelta
|
||||
from datetime import date, time, timedelta
|
||||
from decimal import Decimal
|
||||
from typing import (Any, Callable, Dict, Iterator, List, Optional, Set, Tuple,
|
||||
Type, Union)
|
||||
from uuid import UUID
|
||||
|
||||
from django.contrib.contenttypes.models import ContentType
|
||||
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.expressions import (Combinable, CombinedExpression,
|
||||
Expression, F, SQLiteNumericMixin)
|
||||
from django.db.models.expressions import (Combinable, Expression,
|
||||
SQLiteNumericMixin)
|
||||
from django.db.models.fields import Field, TextField
|
||||
from django.db.models.fields.mixins import FieldCacheMixin
|
||||
from django.db.models.fields.related_lookups import MultiColSource
|
||||
from django.db.models.fields.reverse_related import (ForeignObjectRel,
|
||||
ManyToOneRel)
|
||||
from django.db.models.functions.datetime import TimezoneMixin
|
||||
from django.db.models.lookups import (FieldGetDbPrepValueMixin, Lookup,
|
||||
Transform)
|
||||
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.sql.compiler import SQLCompiler
|
||||
from django.db.models.sql.datastructures import BaseTable, Join
|
||||
@@ -47,21 +43,7 @@ class RawQuery:
|
||||
cursor: Optional[django.db.backends.utils.CursorWrapper] = ...
|
||||
extra_select: Dict[Any, Any] = ...
|
||||
annotation_select: Dict[Any, Any] = ...
|
||||
def __init__(
|
||||
self,
|
||||
sql: str,
|
||||
using: str,
|
||||
params: Optional[
|
||||
Union[
|
||||
Dict[str, str],
|
||||
List[datetime],
|
||||
List[Decimal],
|
||||
List[str],
|
||||
Set[str],
|
||||
Tuple[int],
|
||||
]
|
||||
] = ...,
|
||||
) -> None: ...
|
||||
def __init__(self, sql: str, using: str, params: Any = ...) -> None: ...
|
||||
def chain(self, using: str) -> RawQuery: ...
|
||||
def clone(self, using: str) -> RawQuery: ...
|
||||
def get_columns(self) -> List[str]: ...
|
||||
@@ -82,27 +64,12 @@ class Query:
|
||||
List[Tuple[django.db.models.fields.IntegerField, None, int]],
|
||||
],
|
||||
]
|
||||
values: Union[
|
||||
List[
|
||||
Tuple[
|
||||
django.db.models.fields.CharField,
|
||||
Type[django.db.models.base.Model],
|
||||
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],
|
||||
]
|
||||
],
|
||||
values: List[
|
||||
Tuple[
|
||||
django.db.models.fields.Field,
|
||||
Union[django.db.models.aggregates.Max, int, str],
|
||||
Union[django.db.models.aggregates.Max, int, str],
|
||||
]
|
||||
]
|
||||
alias_prefix: str = ...
|
||||
subq_aliases: frozenset = ...
|
||||
@@ -172,11 +139,7 @@ class Query:
|
||||
int,
|
||||
Union[
|
||||
Dict[str, Union[ModelState, int, str]],
|
||||
List[
|
||||
Union[
|
||||
Dict[Any, Any], Dict[str, Union[bool, str]], ModelState
|
||||
]
|
||||
],
|
||||
List[Union[Dict[str, Union[bool, str]], ModelState]],
|
||||
Model,
|
||||
ModelState,
|
||||
],
|
||||
@@ -199,13 +162,11 @@ class Query:
|
||||
def get_aggregation(
|
||||
self,
|
||||
using: str,
|
||||
added_aggregate_names: Union[
|
||||
Dict[str, Union[Aggregate, CombinedExpression]], List[str]
|
||||
],
|
||||
added_aggregate_names: Union[Dict[str, SQLiteNumericMixin], List[str]],
|
||||
) -> Union[
|
||||
Dict[str, Optional[int]],
|
||||
Dict[str, Union[date, time]],
|
||||
Dict[str, Union[Decimal, float, int]],
|
||||
Dict[str, Union[Decimal, float]],
|
||||
Dict[str, timedelta],
|
||||
]: ...
|
||||
def get_count(self, using: str) -> int: ...
|
||||
@@ -256,70 +217,8 @@ class Query:
|
||||
self, compiler: SQLCompiler, connection: DatabaseWrapper
|
||||
) -> Tuple[str, Tuple]: ...
|
||||
def resolve_lookup_value(
|
||||
self,
|
||||
value: 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,
|
||||
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,
|
||||
]
|
||||
]: ...
|
||||
self, value: Any, can_reuse: Optional[Set[str]], allow_joins: bool
|
||||
) -> Any: ...
|
||||
def solve_lookup_type(
|
||||
self, lookup: str
|
||||
) -> Union[
|
||||
@@ -333,115 +232,18 @@ class Query:
|
||||
field: FieldCacheMixin,
|
||||
) -> None: ...
|
||||
def check_related_objects(
|
||||
self,
|
||||
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,
|
||||
self, field: Union[Field, ForeignObjectRel], value: Any, opts: Options
|
||||
) -> None: ...
|
||||
def build_lookup(
|
||||
self,
|
||||
lookups: List[str],
|
||||
lhs: Union[Expression, TextField, related_lookups.MultiColSource],
|
||||
rhs: 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,
|
||||
]
|
||||
],
|
||||
rhs: Any,
|
||||
) -> Lookup: ...
|
||||
def try_transform(self, lhs: Expression, name: str) -> Transform: ...
|
||||
def build_filter(
|
||||
self,
|
||||
filter_expr: Union[
|
||||
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,
|
||||
]
|
||||
],
|
||||
],
|
||||
],
|
||||
filter_expr: Union[Dict[str, str], Tuple[str, Any]],
|
||||
branch_negated: bool = ...,
|
||||
current_negated: bool = ...,
|
||||
can_reuse: Optional[Set[str]] = ...,
|
||||
@@ -449,26 +251,7 @@ class Query:
|
||||
split_subq: bool = ...,
|
||||
reuse_with_filtered_relation: bool = ...,
|
||||
) -> Tuple[WhereNode, Union[List[Any], Set[str], Tuple]]: ...
|
||||
def add_filter(
|
||||
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_filter(self, filter_clause: Tuple[str, Any]) -> None: ...
|
||||
def add_q(self, q_object: Q) -> None: ...
|
||||
def build_filtered_relation_q(
|
||||
self,
|
||||
@@ -487,8 +270,10 @@ class Query:
|
||||
allow_many: bool = ...,
|
||||
fail_on_missing: bool = ...,
|
||||
) -> Union[
|
||||
Tuple[List[PathInfo], Tuple[Field], List[str], List[str]],
|
||||
Tuple[List[PathInfo], ForeignObjectRel, Tuple[Field], List[str]],
|
||||
Tuple[
|
||||
List[PathInfo], Tuple[Field], List[str], Union[List[Any], List[str]]
|
||||
],
|
||||
Tuple[List[PathInfo], Field, Tuple[Field], List[str]],
|
||||
]: ...
|
||||
def setup_joins(
|
||||
self,
|
||||
@@ -511,21 +296,7 @@ class Query:
|
||||
) -> Expression: ...
|
||||
def split_exclude(
|
||||
self,
|
||||
filter_expr: Tuple[
|
||||
str,
|
||||
Optional[
|
||||
Union[
|
||||
List[Model],
|
||||
List[str],
|
||||
Tuple[str, str],
|
||||
Model,
|
||||
F,
|
||||
QuerySet,
|
||||
int,
|
||||
str,
|
||||
]
|
||||
],
|
||||
],
|
||||
filter_expr: Tuple[str, Any],
|
||||
can_reuse: Set[str],
|
||||
names_with_path: List[Tuple[str, List[PathInfo]]],
|
||||
) -> Tuple[WhereNode, Tuple]: ...
|
||||
@@ -564,12 +335,10 @@ class Query:
|
||||
def clear_deferred_loading(self) -> None: ...
|
||||
def add_deferred_loading(self, field_names: Tuple[str]) -> None: ...
|
||||
def add_immediate_loading(self, field_names: Tuple[str]) -> None: ...
|
||||
def get_loaded_field_names(
|
||||
self
|
||||
) -> Dict[Type[Model], Union[Set[Any], Set[str]]]: ...
|
||||
def get_loaded_field_names(self) -> Dict[Type[Model], Set[str]]: ...
|
||||
def get_loaded_field_names_cb(
|
||||
self,
|
||||
target: Dict[Type[Model], Union[Set[Any], Set[str]]],
|
||||
target: Dict[Type[Model], Set[str]],
|
||||
model: Type[Model],
|
||||
fields: Union[Set[Field], Set[ManyToOneRel]],
|
||||
) -> None: ...
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
from datetime import date, datetime, time
|
||||
from decimal import Decimal
|
||||
from datetime import datetime
|
||||
from typing import Any, Dict, List, Optional, Tuple, Type, Union
|
||||
from uuid import UUID
|
||||
|
||||
from django.db.models.base import Model
|
||||
from django.db.models.expressions import Combinable
|
||||
from django.db.models.fields import Field
|
||||
from django.db.models.fields.files import FieldFile
|
||||
from django.db.models.fields import DateTimeCheckMixin, Field
|
||||
from django.db.models.query import QuerySet
|
||||
from django.db.models.sql.query import Query
|
||||
from django.db.models.sql.where import WhereNode
|
||||
@@ -110,43 +108,7 @@ class UpdateQuery(Query):
|
||||
subquery: bool
|
||||
table_map: Dict[str, List[str]]
|
||||
used_aliases: Set[str]
|
||||
values: List[
|
||||
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: List[Tuple[django.db.models.fields.Field, Any, Any]]
|
||||
values_select: Tuple
|
||||
where_class: Type[django.db.models.sql.where.WhereNode]
|
||||
compiler: str = ...
|
||||
@@ -171,44 +133,7 @@ class UpdateQuery(Query):
|
||||
],
|
||||
) -> None: ...
|
||||
def add_update_fields(
|
||||
self,
|
||||
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,
|
||||
]
|
||||
],
|
||||
]
|
||||
],
|
||||
self, values_seq: List[Tuple[Field, Any, Any]]
|
||||
) -> None: ...
|
||||
def add_related_update(
|
||||
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]
|
||||
compiler: str = ...
|
||||
fields: Union[
|
||||
List[django.db.models.fields.DateTimeCheckMixin],
|
||||
List[django.db.models.fields.Field],
|
||||
django.utils.datastructures.ImmutableList,
|
||||
] = ...
|
||||
@@ -264,7 +190,7 @@ class InsertQuery(Query):
|
||||
raw: bool = ...
|
||||
def insert_values(
|
||||
self,
|
||||
fields: Union[List[Field], ImmutableList],
|
||||
fields: Union[List[DateTimeCheckMixin], List[Field], ImmutableList],
|
||||
objs: List[Model],
|
||||
raw: bool = ...,
|
||||
) -> None: ...
|
||||
|
||||
@@ -34,8 +34,8 @@ class WhereNode(tree.Node):
|
||||
List[Optional[int]],
|
||||
List[Union[date, str]],
|
||||
List[Union[Decimal, int]],
|
||||
List[Union[float, int]],
|
||||
List[Union[int, str]],
|
||||
List[float],
|
||||
List[memoryview],
|
||||
],
|
||||
]: ...
|
||||
@@ -50,24 +50,53 @@ class WhereNode(tree.Node):
|
||||
],
|
||||
List[
|
||||
Union[
|
||||
django.db.models.lookups.FieldGetDbPrepValueMixin,
|
||||
django.db.models.lookups.Lookup,
|
||||
django.db.models.sql.where.NothingNode,
|
||||
django.db.models.lookups.BuiltinLookup,
|
||||
django.db.models.sql.where.WhereNode,
|
||||
]
|
||||
],
|
||||
List[
|
||||
Union[
|
||||
django.db.models.lookups.FieldGetDbPrepValueMixin,
|
||||
django.db.models.lookups.IsNull,
|
||||
]
|
||||
],
|
||||
List[
|
||||
Union[
|
||||
django.db.models.lookups.FieldGetDbPrepValueMixin,
|
||||
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[
|
||||
Union[
|
||||
django.db.models.sql.where.SubqueryConstraint,
|
||||
django.db.models.sql.where.WhereNode,
|
||||
]
|
||||
],
|
||||
List[django.db.models.fields.related_lookups.RelatedLookupMixin],
|
||||
] = ...
|
||||
def set_source_expressions(
|
||||
self, children: List[FieldGetDbPrepValueMixin]
|
||||
|
||||
@@ -35,30 +35,10 @@ class ConnectionDoesNotExist(Exception): ...
|
||||
class ConnectionHandler:
|
||||
databases: Union[
|
||||
Dict[
|
||||
str,
|
||||
Dict[
|
||||
str, Optional[Union[Dict[Any, Any], Dict[str, bool], int, str]]
|
||||
],
|
||||
str, Dict[str, Optional[Union[Dict[str, Optional[bool]], int, str]]]
|
||||
],
|
||||
Dict[
|
||||
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,
|
||||
]
|
||||
],
|
||||
],
|
||||
],
|
||||
str, Dict[str, Optional[Union[Dict[str, Optional[str]], int, str]]]
|
||||
],
|
||||
]
|
||||
def __init__(
|
||||
|
||||
@@ -1,12 +1,7 @@
|
||||
from typing import Any, Callable, List, Optional, Tuple, Type, Union
|
||||
|
||||
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.template.base import Template
|
||||
from django.test.client import ClientHandler
|
||||
from django.test.testcases import SimpleTestCase
|
||||
|
||||
NONE_ID: Any
|
||||
@@ -24,46 +19,20 @@ class Signal:
|
||||
def connect(
|
||||
self,
|
||||
receiver: Any,
|
||||
sender: Optional[
|
||||
Union[Type[Union[Any, Model]], AppConfig, SimpleTestCase]
|
||||
] = ...,
|
||||
sender: Optional[Union[Type[Model], AppConfig, SimpleTestCase]] = ...,
|
||||
weak: bool = ...,
|
||||
dispatch_uid: Optional[str] = ...,
|
||||
) -> None: ...
|
||||
def disconnect(
|
||||
self,
|
||||
receiver: Optional[Callable] = ...,
|
||||
sender: Optional[
|
||||
Union[Type[Union[Any, Model]], AppConfig, SimpleTestCase]
|
||||
] = ...,
|
||||
sender: Optional[Union[Type[Model], AppConfig, SimpleTestCase]] = ...,
|
||||
dispatch_uid: Optional[str] = ...,
|
||||
) -> bool: ...
|
||||
def has_listeners(self, sender: Any = ...) -> bool: ...
|
||||
def send(
|
||||
self,
|
||||
sender: Optional[
|
||||
Union[
|
||||
Type[
|
||||
Optional[
|
||||
Union[
|
||||
Settings,
|
||||
UserSettingsHolder,
|
||||
WSGIHandler,
|
||||
DatabaseWrapper,
|
||||
Model,
|
||||
ClientHandler,
|
||||
SimpleTestCase,
|
||||
]
|
||||
]
|
||||
],
|
||||
AppConfig,
|
||||
Template,
|
||||
SimpleTestCase,
|
||||
str,
|
||||
]
|
||||
],
|
||||
**named: Any
|
||||
) -> List[Tuple[Optional[str], Optional[str]]]: ...
|
||||
self, sender: Any, **named: Any
|
||||
) -> Union[List[Tuple[None, None]], List[Tuple[str, str]]]: ...
|
||||
def send_robust(
|
||||
self, sender: SimpleTestCase, **named: Any
|
||||
) -> 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 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.forms import BaseForm
|
||||
from django.forms.renderers import DjangoTemplates
|
||||
@@ -16,18 +9,7 @@ from django.utils.safestring import SafeText
|
||||
|
||||
|
||||
class BoundField:
|
||||
initial: Optional[
|
||||
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,
|
||||
]
|
||||
]
|
||||
initial: Any
|
||||
form: django.forms.forms.BaseForm = ...
|
||||
field: django.forms.fields.Field = ...
|
||||
name: str = ...
|
||||
@@ -57,22 +39,7 @@ class BoundField:
|
||||
def as_hidden(self, attrs: None = ..., **kwargs: Any) -> SafeText: ...
|
||||
@property
|
||||
def data(self) -> Any: ...
|
||||
def value(
|
||||
self
|
||||
) -> Optional[
|
||||
Union[
|
||||
List[Union[List[str], str]],
|
||||
List[int],
|
||||
date,
|
||||
time,
|
||||
Decimal,
|
||||
File,
|
||||
float,
|
||||
int,
|
||||
str,
|
||||
UUID,
|
||||
]
|
||||
]: ...
|
||||
def value(self) -> Any: ...
|
||||
def label_tag(
|
||||
self,
|
||||
contents: Optional[str] = ...,
|
||||
@@ -86,24 +53,7 @@ class BoundField:
|
||||
def auto_id(self) -> str: ...
|
||||
@property
|
||||
def id_for_label(self) -> str: ...
|
||||
def initial(
|
||||
self
|
||||
) -> Optional[
|
||||
Union[
|
||||
List[Union[int, str]],
|
||||
List[Model],
|
||||
date,
|
||||
time,
|
||||
timedelta,
|
||||
Model,
|
||||
FieldFile,
|
||||
QuerySet,
|
||||
float,
|
||||
int,
|
||||
str,
|
||||
UUID,
|
||||
]
|
||||
]: ...
|
||||
def initial(self) -> Any: ...
|
||||
def build_widget_attrs(
|
||||
self, attrs: Dict[str, str], widget: Optional[Widget] = ...
|
||||
) -> Dict[str, Union[bool, str]]: ...
|
||||
|
||||
@@ -4,27 +4,12 @@ from decimal import Decimal
|
||||
from typing import Any, Callable, Dict, List, Optional, Tuple, Union
|
||||
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.uploadedfile import SimpleUploadedFile
|
||||
from django.db.models.base import Model
|
||||
from django.db.models.fields.files import FieldFile
|
||||
from django.forms.boundfield import BoundField
|
||||
from django.forms.forms import BaseForm
|
||||
from django.forms.models import ModelChoiceField
|
||||
from django.forms.widgets import (CheckboxInput, ClearableFileInput,
|
||||
EmailInput, HiddenInput, Input, MultiWidget,
|
||||
NumberInput, PasswordInput, RadioSelect,
|
||||
Select, SplitDateTimeWidget, Textarea,
|
||||
TextInput, Widget)
|
||||
from django.forms.widgets import Input, Select, Widget
|
||||
|
||||
|
||||
class Field:
|
||||
@@ -58,125 +43,14 @@ class Field:
|
||||
disabled: bool = ...,
|
||||
label_suffix: Optional[Any] = ...
|
||||
) -> None: ...
|
||||
def prepare_value(
|
||||
self,
|
||||
value: Optional[
|
||||
Union[
|
||||
Dict[str, str],
|
||||
List[Union[List[str], str]],
|
||||
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 prepare_value(self, value: Any) -> Any: ...
|
||||
def to_python(self, value: Any) -> Any: ...
|
||||
def validate(self, value: Any) -> None: ...
|
||||
def run_validators(self, value: Any) -> None: ...
|
||||
def clean(self, value: Any) -> Any: ...
|
||||
def bound_data(self, data: Any, initial: Any) -> Any: ...
|
||||
def widget_attrs(self, widget: Widget) -> Dict[Any, Any]: ...
|
||||
def has_changed(
|
||||
self,
|
||||
initial: Optional[Union[date, time, Decimal, float, int, str]],
|
||||
data: Optional[str],
|
||||
) -> bool: ...
|
||||
def has_changed(self, initial: Any, data: Optional[str]) -> bool: ...
|
||||
def get_bound_field(
|
||||
self, form: BaseForm, field_name: str
|
||||
) -> BoundField: ...
|
||||
@@ -187,34 +61,7 @@ class Field:
|
||||
int,
|
||||
Union[
|
||||
List[Tuple[str, str]],
|
||||
List[
|
||||
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]
|
||||
],
|
||||
List[Union[List[Tuple[str, str]], Field, Widget]],
|
||||
OrderedDict,
|
||||
Field,
|
||||
Widget,
|
||||
@@ -223,176 +70,10 @@ class Field:
|
||||
Dict[
|
||||
int,
|
||||
Union[
|
||||
List[Tuple[str, str]],
|
||||
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]],
|
||||
List[Union[List[Any], ChoiceField, Select]],
|
||||
OrderedDict,
|
||||
Field,
|
||||
Widget,
|
||||
],
|
||||
],
|
||||
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,
|
||||
ChoiceField,
|
||||
Select,
|
||||
],
|
||||
],
|
||||
],
|
||||
@@ -410,8 +91,7 @@ class CharField(Field):
|
||||
show_hidden_initial: bool
|
||||
validators: List[
|
||||
Union[
|
||||
django.core.validators.MaxLengthValidator,
|
||||
django.core.validators.MinLengthValidator,
|
||||
django.core.validators.BaseValidator,
|
||||
django.core.validators.ProhibitNullCharactersValidator,
|
||||
]
|
||||
]
|
||||
@@ -446,12 +126,7 @@ class IntegerField(Field):
|
||||
min_value: Optional[int]
|
||||
required: bool
|
||||
show_hidden_initial: bool
|
||||
validators: List[
|
||||
Union[
|
||||
django.core.validators.MaxValueValidator,
|
||||
django.core.validators.MinValueValidator,
|
||||
]
|
||||
]
|
||||
validators: List[django.core.validators.BaseValidator]
|
||||
widget: django.forms.widgets.NumberInput = ...
|
||||
default_error_messages: Any = ...
|
||||
re_decimal: Any = ...
|
||||
@@ -463,7 +138,7 @@ class IntegerField(Field):
|
||||
**kwargs: Any
|
||||
) -> None: ...
|
||||
def to_python(
|
||||
self, value: Optional[Union[float, int, str]]
|
||||
self, value: Optional[Union[float, str]]
|
||||
) -> Optional[int]: ...
|
||||
def widget_attrs(
|
||||
self, widget: Widget
|
||||
@@ -477,20 +152,15 @@ class FloatField(IntegerField):
|
||||
label: Optional[str]
|
||||
label_suffix: None
|
||||
localize: bool
|
||||
max_value: Optional[Union[float, int]]
|
||||
min_value: Optional[Union[float, int]]
|
||||
max_value: Optional[float]
|
||||
min_value: Optional[float]
|
||||
required: bool
|
||||
show_hidden_initial: bool
|
||||
validators: List[
|
||||
Union[
|
||||
django.core.validators.MaxValueValidator,
|
||||
django.core.validators.MinValueValidator,
|
||||
]
|
||||
]
|
||||
validators: List[django.core.validators.BaseValidator]
|
||||
widget: django.forms.widgets.NumberInput
|
||||
default_error_messages: Any = ...
|
||||
def to_python(
|
||||
self, value: Optional[Union[float, int, str]]
|
||||
self, value: Optional[Union[float, str]]
|
||||
) -> Optional[float]: ...
|
||||
def validate(self, value: Optional[float]) -> None: ...
|
||||
def widget_attrs(
|
||||
@@ -513,9 +183,8 @@ class DecimalField(IntegerField):
|
||||
show_hidden_initial: bool
|
||||
validators: List[
|
||||
Union[
|
||||
django.core.validators.BaseValidator,
|
||||
django.core.validators.DecimalValidator,
|
||||
django.core.validators.MaxValueValidator,
|
||||
django.core.validators.MinValueValidator,
|
||||
]
|
||||
]
|
||||
widget: django.forms.widgets.NumberInput
|
||||
@@ -636,8 +305,7 @@ class RegexField(CharField):
|
||||
strip: bool
|
||||
validators: List[
|
||||
Union[
|
||||
django.core.validators.MaxLengthValidator,
|
||||
django.core.validators.MinLengthValidator,
|
||||
django.core.validators.BaseValidator,
|
||||
django.core.validators.ProhibitNullCharactersValidator,
|
||||
django.core.validators.RegexValidator,
|
||||
]
|
||||
@@ -662,9 +330,8 @@ class EmailField(CharField):
|
||||
strip: bool
|
||||
validators: List[
|
||||
Union[
|
||||
django.core.validators.BaseValidator,
|
||||
django.core.validators.EmailValidator,
|
||||
django.core.validators.MaxLengthValidator,
|
||||
django.core.validators.MinLengthValidator,
|
||||
django.core.validators.ProhibitNullCharactersValidator,
|
||||
]
|
||||
]
|
||||
@@ -809,66 +476,14 @@ class ChoiceField(Field):
|
||||
def __init__(self, *, choices: Any = ..., **kwargs: Any) -> None: ...
|
||||
def __deepcopy__(
|
||||
self,
|
||||
memo: Union[
|
||||
Dict[
|
||||
int,
|
||||
Union[
|
||||
List[
|
||||
Union[
|
||||
List[Tuple[str, str]],
|
||||
CharField,
|
||||
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,
|
||||
],
|
||||
memo: Dict[
|
||||
int,
|
||||
Union[
|
||||
List[Tuple[str, str]],
|
||||
List[Union[List[Tuple[str, str]], Field, Widget]],
|
||||
OrderedDict,
|
||||
Field,
|
||||
Widget,
|
||||
],
|
||||
],
|
||||
) -> ChoiceField: ...
|
||||
@@ -892,7 +507,7 @@ class TypedChoiceField(ChoiceField):
|
||||
) -> None: ...
|
||||
def clean(
|
||||
self, value: Optional[str]
|
||||
) -> Optional[Union[Decimal, float, int, str]]: ...
|
||||
) -> Optional[Union[Decimal, float, str]]: ...
|
||||
|
||||
class MultipleChoiceField(ChoiceField):
|
||||
disabled: bool
|
||||
@@ -969,33 +584,20 @@ class MultiValueField(Field):
|
||||
) -> None: ...
|
||||
def __deepcopy__(
|
||||
self,
|
||||
memo: Dict[
|
||||
int,
|
||||
Union[
|
||||
List[Tuple[str, str]],
|
||||
List[
|
||||
Union[
|
||||
List[Tuple[str, str]],
|
||||
AdminEmailInputWidget,
|
||||
RelatedFieldWidgetWrapper,
|
||||
ReadOnlyPasswordHashField,
|
||||
ReadOnlyPasswordHashWidget,
|
||||
BooleanField,
|
||||
CharField,
|
||||
SplitDateTimeField,
|
||||
ModelChoiceField,
|
||||
CheckboxInput,
|
||||
MultiWidget,
|
||||
Select,
|
||||
TextInput,
|
||||
]
|
||||
memo: Union[
|
||||
Dict[
|
||||
int,
|
||||
Union[
|
||||
List[Tuple[str, str]],
|
||||
List[Union[List[Tuple[str, str]], Widget]],
|
||||
OrderedDict,
|
||||
Field,
|
||||
Widget,
|
||||
],
|
||||
List[
|
||||
Union[AdminTextInputWidget, AdminTextareaWidget, CharField]
|
||||
],
|
||||
OrderedDict,
|
||||
Field,
|
||||
Widget,
|
||||
],
|
||||
Dict[
|
||||
int,
|
||||
Union[List[Union[Field, Widget]], OrderedDict, Field, Widget],
|
||||
],
|
||||
],
|
||||
) -> MultiValueField: ...
|
||||
|
||||
@@ -57,8 +57,8 @@ class BaseForm:
|
||||
prefix: Optional[str] = ...,
|
||||
initial: Optional[
|
||||
Union[
|
||||
Dict[str, List[int]],
|
||||
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[str], str]],
|
||||
Dict[str, Union[FieldFile, int, str]],
|
||||
@@ -93,7 +93,7 @@ class BaseForm:
|
||||
self
|
||||
) -> Union[
|
||||
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, SimpleUploadedFile],
|
||||
Dict[str, QuerySet],
|
||||
@@ -105,20 +105,6 @@ class BaseForm:
|
||||
def is_multipart(self): ...
|
||||
def hidden_fields(self): ...
|
||||
def visible_fields(self): ...
|
||||
def get_initial_for_field(
|
||||
self, field: Field, field_name: str
|
||||
) -> Optional[
|
||||
Union[
|
||||
List[Model],
|
||||
List[int],
|
||||
List[str],
|
||||
date,
|
||||
Model,
|
||||
FieldFile,
|
||||
QuerySet,
|
||||
int,
|
||||
str,
|
||||
]
|
||||
]: ...
|
||||
def get_initial_for_field(self, field: Field, field_name: str) -> Any: ...
|
||||
|
||||
class Form(BaseForm): ...
|
||||
|
||||
@@ -6,15 +6,7 @@ from typing import (Any, Callable, Dict, Iterator, List, Optional, Tuple, Type,
|
||||
from unittest.mock import MagicMock
|
||||
from uuid import UUID
|
||||
|
||||
from django.contrib.admin.widgets import (AdminEmailInputWidget,
|
||||
AdminFileWidget, AdminSplitDateTime,
|
||||
AdminTextInputWidget,
|
||||
AdminURLFieldWidget,
|
||||
FilteredSelectMultiple,
|
||||
RelatedFieldWidgetWrapper)
|
||||
from django.contrib.auth.forms import (ReadOnlyPasswordHashField,
|
||||
ReadOnlyPasswordHashWidget,
|
||||
UserChangeForm, UserCreationForm)
|
||||
from django.contrib.auth.forms import UserChangeForm, UserCreationForm
|
||||
from django.contrib.flatpages.forms import FlatpageForm
|
||||
from django.core.files.base import File
|
||||
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.query import QuerySet
|
||||
from django.db.models.query_utils import Q
|
||||
from django.forms.fields import (BooleanField, CharField, ChoiceField,
|
||||
DateField, DateTimeField, Field, FileField,
|
||||
IntegerField, SplitDateTimeField, URLField)
|
||||
from django.forms.fields import CharField, ChoiceField, Field
|
||||
from django.forms.forms import BaseForm, DeclarativeFieldsMetaclass
|
||||
from django.forms.formsets import BaseFormSet
|
||||
from django.forms.utils import ErrorList
|
||||
from django.forms.widgets import (CheckboxInput, DateTimeInput, NumberInput,
|
||||
RadioSelect, Select, SelectMultiple,
|
||||
Textarea, TextInput, Widget)
|
||||
from django.forms.widgets import Widget
|
||||
|
||||
ALL_FIELDS: str
|
||||
|
||||
@@ -84,7 +72,6 @@ class ModelFormOptions:
|
||||
options: Optional[
|
||||
Type[
|
||||
Union[
|
||||
Any,
|
||||
UserChangeForm.Meta,
|
||||
UserCreationForm.Meta,
|
||||
FlatpageForm.Meta,
|
||||
@@ -136,7 +123,7 @@ class BaseModelForm(BaseForm):
|
||||
Dict[str, Optional[Union[bool, datetime, QuerySet, str]]],
|
||||
Dict[str, Optional[Union[date, Model, QuerySet, 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]],
|
||||
]: ...
|
||||
def validate_unique(self) -> None: ...
|
||||
@@ -339,96 +326,13 @@ class ModelChoiceField(ChoiceField):
|
||||
]: ...
|
||||
def __deepcopy__(
|
||||
self,
|
||||
memo: Union[
|
||||
Dict[
|
||||
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,
|
||||
],
|
||||
],
|
||||
memo: Dict[
|
||||
int, Union[List[Union[Field, Widget]], OrderedDict, Field, Widget]
|
||||
],
|
||||
) -> ModelChoiceField: ...
|
||||
def label_from_instance(self, obj: Model) -> str: ...
|
||||
choices: Any = ...
|
||||
def prepare_value(
|
||||
self,
|
||||
value: Optional[
|
||||
Union[Dict[str, str], List[str], Model, int, str, UUID]
|
||||
],
|
||||
) -> Optional[Union[Dict[str, str], List[str], int, str, UUID]]: ...
|
||||
def prepare_value(self, value: Any) -> Any: ...
|
||||
def to_python(
|
||||
self,
|
||||
value: Optional[Union[List[Dict[str, str]], List[List[str]], int, str]],
|
||||
@@ -526,19 +430,7 @@ class ModelMultipleChoiceField(ModelChoiceField):
|
||||
],
|
||||
) -> QuerySet: ...
|
||||
def prepare_value(
|
||||
self,
|
||||
value: Optional[
|
||||
Union[
|
||||
List[Dict[str, str]],
|
||||
List[List[str]],
|
||||
List[Union[int, str]],
|
||||
List[Model],
|
||||
Tuple,
|
||||
Model,
|
||||
QuerySet,
|
||||
str,
|
||||
]
|
||||
],
|
||||
self, value: Any
|
||||
) -> Optional[
|
||||
Union[
|
||||
List[Dict[str, str]],
|
||||
|
||||
@@ -22,34 +22,7 @@ class BaseRenderer:
|
||||
str,
|
||||
Optional[
|
||||
Union[
|
||||
Dict[str, Union[bool, Decimal, 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]],
|
||||
Dict[str, Union[bool, float, str]],
|
||||
List[
|
||||
Union[
|
||||
Dict[
|
||||
@@ -80,21 +53,10 @@ class BaseRenderer:
|
||||
]
|
||||
],
|
||||
],
|
||||
Dict[
|
||||
str,
|
||||
Optional[
|
||||
Union[
|
||||
Dict[str, Union[bool, str]],
|
||||
bool,
|
||||
str,
|
||||
]
|
||||
],
|
||||
],
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
Dict[str, Union[bool, str]],
|
||||
List[Any],
|
||||
List[
|
||||
Tuple[
|
||||
None,
|
||||
@@ -129,73 +91,19 @@ class BaseRenderer:
|
||||
str,
|
||||
Optional[
|
||||
Union[
|
||||
Dict[str, Union[float, int, str]],
|
||||
Dict[str, Union[Decimal, int, str]],
|
||||
List[
|
||||
Dict[
|
||||
str,
|
||||
Optional[Union[Dict[str, str], bool, str]],
|
||||
]
|
||||
],
|
||||
bool,
|
||||
int,
|
||||
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[
|
||||
str,
|
||||
Dict[
|
||||
@@ -204,14 +112,11 @@ class BaseRenderer:
|
||||
Dict[Any, Any],
|
||||
List[
|
||||
Tuple[
|
||||
None,
|
||||
List[
|
||||
Dict[
|
||||
str,
|
||||
Union[Dict[Any, Any], bool, time, str],
|
||||
]
|
||||
Dict[str, Union[Dict[Any, Any], bool, str]]
|
||||
],
|
||||
int,
|
||||
int,
|
||||
]
|
||||
],
|
||||
List[str],
|
||||
@@ -244,41 +149,24 @@ class BaseRenderer:
|
||||
str,
|
||||
],
|
||||
],
|
||||
Dict[str, Union[Dict[Any, Any], bool, str]],
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
Dict[str, bool],
|
||||
List[
|
||||
Union[
|
||||
Tuple[
|
||||
None,
|
||||
List[
|
||||
Dict[
|
||||
Tuple[
|
||||
None,
|
||||
List[
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
Dict[str, bool],
|
||||
bool,
|
||||
str,
|
||||
Union[
|
||||
Dict[Any, Any],
|
||||
bool,
|
||||
str,
|
||||
],
|
||||
]
|
||||
],
|
||||
int,
|
||||
],
|
||||
Tuple[
|
||||
None,
|
||||
List[
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
Dict[str, bool],
|
||||
bool,
|
||||
str,
|
||||
],
|
||||
]
|
||||
],
|
||||
int,
|
||||
],
|
||||
]
|
||||
],
|
||||
int,
|
||||
]
|
||||
],
|
||||
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],
|
||||
bool,
|
||||
str,
|
||||
@@ -304,108 +227,12 @@ class BaseRenderer:
|
||||
Tuple[
|
||||
None,
|
||||
List[
|
||||
Dict[str, Union[Dict[str, str], int, str]]
|
||||
],
|
||||
int,
|
||||
]
|
||||
],
|
||||
List[
|
||||
Union[
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
Dict[str, Union[bool, str]],
|
||||
List[
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
Dict[str, Union[bool, str]],
|
||||
bool,
|
||||
str,
|
||||
],
|
||||
]
|
||||
],
|
||||
bool,
|
||||
Dict[
|
||||
str,
|
||||
],
|
||||
],
|
||||
Dict[
|
||||
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[
|
||||
Union[
|
||||
Dict[str, Union[bool, str]],
|
||||
int,
|
||||
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]],
|
||||
List[
|
||||
Union[
|
||||
Tuple[
|
||||
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[
|
||||
Dict[
|
||||
str,
|
||||
List[
|
||||
Union[
|
||||
Union[
|
||||
Dict[str, Union[bool, str]],
|
||||
List[
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
@@ -611,21 +265,40 @@ class BaseRenderer:
|
||||
bool,
|
||||
str,
|
||||
],
|
||||
],
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
Dict[str, str], bool, 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],
|
||||
int,
|
||||
bool,
|
||||
str,
|
||||
],
|
||||
],
|
||||
@@ -635,7 +308,7 @@ class BaseRenderer:
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
Dict[str, bool],
|
||||
Dict[str, Union[bool, str]],
|
||||
List[
|
||||
Union[
|
||||
Tuple[
|
||||
@@ -643,17 +316,17 @@ class BaseRenderer:
|
||||
List[
|
||||
Dict[
|
||||
str,
|
||||
Union[Dict[Any, Any], bool, str],
|
||||
Union[Dict[str, bool], bool, str],
|
||||
]
|
||||
],
|
||||
int,
|
||||
],
|
||||
Tuple[
|
||||
None,
|
||||
str,
|
||||
List[
|
||||
Dict[
|
||||
str,
|
||||
Union[Dict[str, bool], bool, str],
|
||||
Union[Dict[Any, Any], bool, str],
|
||||
]
|
||||
],
|
||||
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[
|
||||
str,
|
||||
Dict[
|
||||
@@ -673,37 +396,12 @@ class BaseRenderer:
|
||||
Union[
|
||||
Dict[str, bool],
|
||||
List[
|
||||
Union[
|
||||
Tuple[
|
||||
None,
|
||||
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,
|
||||
Tuple[
|
||||
List[
|
||||
Dict[str, Union[Dict[str, bool], bool, str]]
|
||||
],
|
||||
int,
|
||||
int,
|
||||
]
|
||||
],
|
||||
List[str],
|
||||
@@ -732,30 +430,14 @@ class BaseRenderer:
|
||||
Union[
|
||||
Dict[str, 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,
|
||||
Tuple[
|
||||
None,
|
||||
List[
|
||||
Dict[str, Union[Dict[str, str], int, str]]
|
||||
],
|
||||
int,
|
||||
]
|
||||
],
|
||||
List[str],
|
||||
bool,
|
||||
str,
|
||||
],
|
||||
@@ -784,28 +466,10 @@ class BaseRenderer:
|
||||
List[
|
||||
Dict[
|
||||
str,
|
||||
Union[Dict[str, str], bool, str],
|
||||
]
|
||||
],
|
||||
int,
|
||||
],
|
||||
Tuple[
|
||||
str,
|
||||
List[
|
||||
Union[
|
||||
Dict[
|
||||
Union[
|
||||
Dict[str, Union[bool, str]],
|
||||
bool,
|
||||
str,
|
||||
Union[
|
||||
Dict[str, Union[bool, str]],
|
||||
bool,
|
||||
str,
|
||||
],
|
||||
],
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
Dict[str, str], bool, str
|
||||
],
|
||||
],
|
||||
]
|
||||
],
|
||||
@@ -909,7 +573,34 @@ class BaseRenderer:
|
||||
str,
|
||||
Union[
|
||||
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,
|
||||
str,
|
||||
],
|
||||
@@ -924,47 +615,7 @@ class BaseRenderer:
|
||||
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],
|
||||
List[Dict[str, Union[Dict[str, str], bool, str]]],
|
||||
bool,
|
||||
str,
|
||||
],
|
||||
@@ -1000,47 +651,8 @@ class BaseRenderer:
|
||||
Dict[
|
||||
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,
|
||||
],
|
||||
Tuple[
|
||||
str,
|
||||
List[
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
Dict[Any, Any], bool, str
|
||||
],
|
||||
]
|
||||
],
|
||||
int,
|
||||
],
|
||||
]
|
||||
],
|
||||
Dict[str, str],
|
||||
List[Dict[str, Union[Dict[str, str], bool, str]]],
|
||||
List[str],
|
||||
bool,
|
||||
str,
|
||||
@@ -1056,8 +668,18 @@ class BaseRenderer:
|
||||
str,
|
||||
Union[
|
||||
Dict[str, str],
|
||||
List[Dict[str, Union[Dict[str, str], bool, str]]],
|
||||
List[str],
|
||||
List[
|
||||
Tuple[
|
||||
None,
|
||||
List[
|
||||
Dict[
|
||||
str,
|
||||
Union[Dict[str, str], bool, str],
|
||||
]
|
||||
],
|
||||
int,
|
||||
]
|
||||
],
|
||||
bool,
|
||||
str,
|
||||
],
|
||||
@@ -1065,6 +687,51 @@ class BaseRenderer:
|
||||
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]],
|
||||
],
|
||||
request: None = ...,
|
||||
|
||||
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.http.request import QueryDict
|
||||
from django.test.client import FakePayload
|
||||
from django.utils.datastructures import ImmutableList, MultiValueDict
|
||||
|
||||
|
||||
@@ -13,12 +12,7 @@ class InputStreamExhausted(Exception): ...
|
||||
class MultiPartParser:
|
||||
def __init__(
|
||||
self,
|
||||
META: Dict[
|
||||
str,
|
||||
Union[
|
||||
Dict[str, str], Tuple[int, int], BytesIO, FakePayload, int, str
|
||||
],
|
||||
],
|
||||
META: Dict[str, Any],
|
||||
input_data: Union[BytesIO, StringIO, WSGIRequest],
|
||||
upload_handlers: Union[List[Any], ImmutableList],
|
||||
encoding: Optional[str] = ...,
|
||||
@@ -73,7 +67,6 @@ class Parser:
|
||||
Tuple[
|
||||
str,
|
||||
Union[
|
||||
Dict[Any, Any],
|
||||
Dict[str, Union[bytes, str]],
|
||||
Dict[str, bytes],
|
||||
Dict[str, str],
|
||||
|
||||
@@ -2,7 +2,6 @@ from io import BytesIO
|
||||
from typing import Any, Dict, Iterator, List, Optional, Tuple, Union
|
||||
|
||||
from django.core.handlers.wsgi import WSGIRequest
|
||||
from django.test.client import FakePayload
|
||||
from django.utils.datastructures import MultiValueDict
|
||||
|
||||
RAISE_ERROR: Any
|
||||
@@ -56,14 +55,7 @@ class HttpRequest:
|
||||
def upload_handlers(self, upload_handlers: Any) -> None: ...
|
||||
upload_handlers: Any = ...
|
||||
def parse_file_upload(
|
||||
self,
|
||||
META: Dict[
|
||||
str,
|
||||
Union[
|
||||
Dict[str, str], Tuple[int, int], BytesIO, FakePayload, int, str
|
||||
],
|
||||
],
|
||||
post_data: Union[BytesIO, WSGIRequest],
|
||||
self, META: Dict[str, Any], post_data: Union[BytesIO, WSGIRequest]
|
||||
) -> Tuple[QueryDict, MultiValueDict]: ...
|
||||
@property
|
||||
def body(self) -> bytes: ...
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
from datetime import datetime
|
||||
from io import BufferedReader, BytesIO, TextIOWrapper
|
||||
from io import BufferedReader, BytesIO
|
||||
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 django.core.files.base import ContentFile
|
||||
@@ -93,12 +93,7 @@ class HttpResponse(HttpResponseBase):
|
||||
streaming: bool = ...
|
||||
content: Any = ...
|
||||
def __init__(
|
||||
self,
|
||||
content: Union[
|
||||
Iterator[Any], List[str], TextIOWrapper, bytes, int, str
|
||||
] = ...,
|
||||
*args: Any,
|
||||
**kwargs: Any
|
||||
self, content: Any = ..., *args: Any, **kwargs: Any
|
||||
) -> None: ...
|
||||
def serialize(self): ...
|
||||
__bytes__: Any = ...
|
||||
@@ -127,20 +122,7 @@ class StreamingHttpResponse(HttpResponseBase):
|
||||
streaming: bool = ...
|
||||
streaming_content: Any = ...
|
||||
def __init__(
|
||||
self,
|
||||
streaming_content: Union[
|
||||
Iterator[Any],
|
||||
List[bytes],
|
||||
List[str],
|
||||
BufferedReader,
|
||||
BytesIO,
|
||||
TextIOWrapper,
|
||||
ContentFile,
|
||||
str,
|
||||
_TemporaryFileWrapper,
|
||||
] = ...,
|
||||
*args: Any,
|
||||
**kwargs: Any
|
||||
self, streaming_content: Any = ..., *args: Any, **kwargs: Any
|
||||
) -> None: ...
|
||||
@property
|
||||
def content(self) -> Any: ...
|
||||
@@ -306,8 +288,9 @@ class JsonResponse(HttpResponse):
|
||||
def __init__(
|
||||
self,
|
||||
data: Union[
|
||||
Dict[str, 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],
|
||||
List[int],
|
||||
List[str],
|
||||
|
||||
@@ -6,7 +6,7 @@ from django.utils.deprecation import MiddlewareMixin
|
||||
|
||||
|
||||
class UpdateCacheMiddleware(MiddlewareMixin):
|
||||
cache_timeout: Union[float, int] = ...
|
||||
cache_timeout: float = ...
|
||||
key_prefix: str = ...
|
||||
cache_alias: str = ...
|
||||
cache: Union[
|
||||
@@ -36,11 +36,11 @@ class CacheMiddleware(UpdateCacheMiddleware, FetchFromCacheMiddleware):
|
||||
get_response: None = ...
|
||||
key_prefix: str = ...
|
||||
cache_alias: str = ...
|
||||
cache_timeout: Union[float, int] = ...
|
||||
cache_timeout: float = ...
|
||||
cache: django.core.cache.backends.locmem.LocMemCache = ...
|
||||
def __init__(
|
||||
self,
|
||||
get_response: None = ...,
|
||||
cache_timeout: Optional[Union[float, int]] = ...,
|
||||
cache_timeout: Optional[float] = ...,
|
||||
**kwargs: Any
|
||||
) -> None: ...
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -39,34 +39,7 @@ class Template:
|
||||
context: Optional[
|
||||
Union[
|
||||
Dict[
|
||||
str,
|
||||
Dict[
|
||||
str,
|
||||
Optional[
|
||||
Union[
|
||||
Dict[str, int],
|
||||
List[
|
||||
Tuple[
|
||||
None,
|
||||
List[
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
Dict[Any, Any],
|
||||
time,
|
||||
int,
|
||||
str,
|
||||
],
|
||||
]
|
||||
],
|
||||
int,
|
||||
]
|
||||
],
|
||||
bool,
|
||||
str,
|
||||
]
|
||||
],
|
||||
],
|
||||
str, Dict[str, Optional[Union[Dict[str, bool], bool, str]]]
|
||||
],
|
||||
Dict[
|
||||
str,
|
||||
@@ -101,35 +74,19 @@ class Template:
|
||||
Union[
|
||||
Dict[Any, Any],
|
||||
List[
|
||||
Union[
|
||||
Tuple[
|
||||
None,
|
||||
List[
|
||||
Dict[
|
||||
Tuple[
|
||||
None,
|
||||
List[
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
Dict[str, bool],
|
||||
bool,
|
||||
str,
|
||||
Union[
|
||||
Dict[Any, Any],
|
||||
bool,
|
||||
str,
|
||||
],
|
||||
]
|
||||
],
|
||||
int,
|
||||
],
|
||||
Tuple[
|
||||
None,
|
||||
List[
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
Dict[str, bool],
|
||||
bool,
|
||||
str,
|
||||
],
|
||||
]
|
||||
],
|
||||
int,
|
||||
],
|
||||
]
|
||||
],
|
||||
int,
|
||||
]
|
||||
],
|
||||
List[str],
|
||||
@@ -152,16 +109,14 @@ class Template:
|
||||
Dict[Any, Any],
|
||||
List[
|
||||
Tuple[
|
||||
None,
|
||||
List[
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
Dict[Any, Any], bool, time, str
|
||||
],
|
||||
Union[Dict[Any, Any], bool, str],
|
||||
]
|
||||
],
|
||||
int,
|
||||
int,
|
||||
]
|
||||
],
|
||||
List[str],
|
||||
@@ -196,46 +151,24 @@ class Template:
|
||||
str,
|
||||
],
|
||||
],
|
||||
Dict[str, Union[Dict[Any, Any], bool, str]],
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
Dict[str, bool],
|
||||
List[
|
||||
Union[
|
||||
Tuple[
|
||||
None,
|
||||
List[
|
||||
Dict[
|
||||
Tuple[
|
||||
None,
|
||||
List[
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
Dict[str, bool],
|
||||
bool,
|
||||
str,
|
||||
Union[
|
||||
Dict[
|
||||
Any, Any
|
||||
],
|
||||
bool,
|
||||
str,
|
||||
],
|
||||
]
|
||||
],
|
||||
int,
|
||||
],
|
||||
Tuple[
|
||||
None,
|
||||
List[
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
Dict[
|
||||
str,
|
||||
bool,
|
||||
],
|
||||
bool,
|
||||
str,
|
||||
],
|
||||
]
|
||||
],
|
||||
int,
|
||||
],
|
||||
]
|
||||
],
|
||||
int,
|
||||
]
|
||||
],
|
||||
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[
|
||||
str,
|
||||
Dict[
|
||||
@@ -389,31 +230,15 @@ class Template:
|
||||
Union[
|
||||
Dict[str, bool],
|
||||
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,
|
||||
Tuple[
|
||||
List[
|
||||
Dict[
|
||||
str,
|
||||
Union[Dict[str, bool], bool, str],
|
||||
]
|
||||
],
|
||||
int,
|
||||
int,
|
||||
]
|
||||
],
|
||||
List[str],
|
||||
@@ -429,43 +254,41 @@ class Template:
|
||||
Union[
|
||||
Dict[str, bool],
|
||||
List[
|
||||
Union[
|
||||
Tuple[
|
||||
None,
|
||||
List[
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
Dict[str, bool], bool, str
|
||||
],
|
||||
]
|
||||
],
|
||||
int,
|
||||
Tuple[
|
||||
None,
|
||||
List[
|
||||
Dict[
|
||||
str,
|
||||
Union[Dict[str, bool], int, str],
|
||||
]
|
||||
],
|
||||
Tuple[
|
||||
str,
|
||||
List[
|
||||
int,
|
||||
]
|
||||
],
|
||||
List[str],
|
||||
bool,
|
||||
str,
|
||||
],
|
||||
],
|
||||
],
|
||||
Dict[
|
||||
str,
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
Dict[str, int],
|
||||
List[
|
||||
Tuple[
|
||||
None,
|
||||
List[
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
Dict[Any, Any],
|
||||
bool,
|
||||
str,
|
||||
],
|
||||
],
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
Dict[str, bool],
|
||||
bool,
|
||||
str,
|
||||
],
|
||||
],
|
||||
]
|
||||
],
|
||||
int,
|
||||
Dict[Any, Any], time, int, str
|
||||
],
|
||||
]
|
||||
],
|
||||
int,
|
||||
]
|
||||
],
|
||||
List[str],
|
||||
@@ -494,29 +317,43 @@ class Template:
|
||||
Union[
|
||||
Dict[str, str],
|
||||
List[
|
||||
Union[
|
||||
Tuple[
|
||||
None,
|
||||
List[
|
||||
Dict[
|
||||
Tuple[
|
||||
None,
|
||||
List[
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
Dict[str, Union[bool, str]],
|
||||
bool,
|
||||
str,
|
||||
Union[Dict[Any, Any], int, str],
|
||||
]
|
||||
],
|
||||
int,
|
||||
],
|
||||
]
|
||||
],
|
||||
Tuple[
|
||||
None,
|
||||
List[
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
Dict[str, bool], int, str
|
||||
],
|
||||
]
|
||||
],
|
||||
int,
|
||||
int,
|
||||
]
|
||||
],
|
||||
List[str],
|
||||
bool,
|
||||
str,
|
||||
],
|
||||
],
|
||||
],
|
||||
Dict[
|
||||
str,
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
Dict[str, str],
|
||||
List[
|
||||
Tuple[
|
||||
None,
|
||||
List[
|
||||
Dict[
|
||||
str,
|
||||
Union[Dict[str, bool], int, str],
|
||||
]
|
||||
],
|
||||
int,
|
||||
]
|
||||
],
|
||||
List[str],
|
||||
@@ -534,7 +371,19 @@ class Template:
|
||||
List[
|
||||
Union[
|
||||
Tuple[
|
||||
None,
|
||||
List[
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
Dict[str, str], bool, str
|
||||
],
|
||||
]
|
||||
],
|
||||
int,
|
||||
int,
|
||||
],
|
||||
Tuple[
|
||||
str,
|
||||
List[
|
||||
Dict[
|
||||
str,
|
||||
@@ -547,13 +396,41 @@ class Template:
|
||||
],
|
||||
int,
|
||||
],
|
||||
]
|
||||
],
|
||||
List[str],
|
||||
bool,
|
||||
str,
|
||||
],
|
||||
],
|
||||
],
|
||||
Dict[
|
||||
str,
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
Dict[str, str],
|
||||
List[
|
||||
Union[
|
||||
Tuple[
|
||||
None,
|
||||
List[
|
||||
Dict[
|
||||
str,
|
||||
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[
|
||||
str,
|
||||
Union[
|
||||
Dict[str, str], bool, str
|
||||
],
|
||||
]
|
||||
],
|
||||
int,
|
||||
],
|
||||
Tuple[
|
||||
str,
|
||||
List[
|
||||
Union[
|
||||
Dict[
|
||||
Dict[str, Union[bool, str]],
|
||||
bool,
|
||||
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 io import BytesIO
|
||||
from sqlite3 import OperationalError
|
||||
from typing import (Any, Callable, Dict, Iterator, List, Optional, Tuple, Type,
|
||||
Union)
|
||||
from typing import Any, Callable, Dict, Iterator, List, Optional, Tuple, 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.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.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 .library import Library
|
||||
@@ -53,7 +16,7 @@ def capfirst(value: str) -> str: ...
|
||||
def escapejs_filter(value: str) -> SafeText: ...
|
||||
def json_script(value: Dict[str, str], element_id: SafeText) -> SafeText: ...
|
||||
def floatformat(
|
||||
text: Optional[Union[Decimal, float, int, str]], arg: Union[int, str] = ...
|
||||
text: Optional[Union[Decimal, float, str]], arg: Union[int, str] = ...
|
||||
) -> str: ...
|
||||
def iriencode(value: str) -> str: ...
|
||||
def linenumbers(value: str, autoescape: bool = ...) -> SafeText: ...
|
||||
@@ -119,26 +82,11 @@ def last(value: List[str]) -> str: ...
|
||||
def length(
|
||||
value: Optional[
|
||||
Union[
|
||||
List[Optional[Union[Dict[Any, Any], int, str]]],
|
||||
AdminErrorList,
|
||||
QuerySet,
|
||||
int,
|
||||
str,
|
||||
List[Optional[Union[Dict[Any, Any], int, str]]], QuerySet, int, str
|
||||
]
|
||||
]
|
||||
) -> int: ...
|
||||
def length_is(
|
||||
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 length_is(value: Any, arg: Union[SafeText, int]) -> Union[bool, str]: ...
|
||||
def random(value: List[str]) -> str: ...
|
||||
def slice_filter(value: Any, arg: str) -> Any: ...
|
||||
def unordered_list(
|
||||
@@ -179,118 +127,4 @@ def yesno(
|
||||
def filesizeformat(bytes_: Union[complex, int, str]) -> str: ...
|
||||
def pluralize(value: Any, arg: str = ...) -> str: ...
|
||||
def phone2numeric_filter(value: str) -> str: ...
|
||||
def pprint(
|
||||
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: ...
|
||||
def pprint(value: Any) -> str: ...
|
||||
|
||||
@@ -1,24 +1,10 @@
|
||||
from collections import namedtuple
|
||||
from datetime import date, time
|
||||
from decimal import Decimal
|
||||
from sqlite3 import OperationalError
|
||||
from typing import Any, Dict, List, Optional, Set, Tuple, Union
|
||||
from datetime import date
|
||||
from typing import Any, Dict, List, Optional, 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.context import Context, RequestContext
|
||||
from django.template.exceptions import TemplateDoesNotExist
|
||||
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 .base import (BLOCK_TAG_END, BLOCK_TAG_START, COMMENT_TAG_END,
|
||||
@@ -144,19 +130,10 @@ class IfNode(Node):
|
||||
origin: django.template.base.Origin
|
||||
token: django.template.base.Token
|
||||
conditions_nodelists: List[
|
||||
Union[
|
||||
Tuple[None, django.template.base.NodeList],
|
||||
Tuple[
|
||||
django.template.defaulttags.TemplateLiteral,
|
||||
django.template.base.NodeList,
|
||||
],
|
||||
]
|
||||
Tuple[django.template.base.NodeList, django.template.base.NodeList]
|
||||
] = ...
|
||||
def __init__(
|
||||
self,
|
||||
conditions_nodelists: List[
|
||||
Union[Tuple[None, NodeList], Tuple[TemplateLiteral, NodeList]]
|
||||
],
|
||||
self, conditions_nodelists: List[Tuple[NodeList, NodeList]]
|
||||
) -> None: ...
|
||||
def __iter__(self) -> None: ...
|
||||
@property
|
||||
@@ -308,50 +285,7 @@ class TemplateLiteral(Literal):
|
||||
text: str = ...
|
||||
def __init__(self, value: FilterExpression, text: str) -> None: ...
|
||||
def display(self) -> str: ...
|
||||
def eval(
|
||||
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,
|
||||
]
|
||||
]: ...
|
||||
def eval(self, context: Context) -> Any: ...
|
||||
|
||||
class TemplateIfParser(IfParser):
|
||||
current_token: django.template.defaulttags.TemplateLiteral
|
||||
|
||||
@@ -29,7 +29,6 @@ class Engine:
|
||||
str,
|
||||
Union[
|
||||
Dict[str, str],
|
||||
List[Any],
|
||||
List[Tuple[str, Dict[str, str]]],
|
||||
List[str],
|
||||
],
|
||||
@@ -59,7 +58,6 @@ class Engine:
|
||||
str,
|
||||
Union[
|
||||
Dict[str, str],
|
||||
List[Any],
|
||||
List[Tuple[str, Dict[str, str]]],
|
||||
List[str],
|
||||
],
|
||||
@@ -93,7 +91,6 @@ class Engine:
|
||||
str,
|
||||
Union[
|
||||
Dict[str, str],
|
||||
List[Any],
|
||||
List[Tuple[str, Dict[str, str]]],
|
||||
List[str],
|
||||
],
|
||||
@@ -133,10 +130,9 @@ class Engine:
|
||||
Dict[str, Dict[str, List[Tuple[str, int]]]],
|
||||
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[str], 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[Union[List[SafeText], str]]],
|
||||
Dict[str, List[Template]],
|
||||
Dict[str, Optional[int]],
|
||||
Dict[str, Optional[str]],
|
||||
@@ -155,15 +151,28 @@ class Engine:
|
||||
Dict[str, Union[Dict[str, int], str]],
|
||||
Dict[
|
||||
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[float, int]],
|
||||
Dict[str, Union[int, str]],
|
||||
Dict[str, time],
|
||||
Dict[str, Template],
|
||||
Dict[str, float],
|
||||
Dict[str, range],
|
||||
]
|
||||
] = ...,
|
||||
|
||||
@@ -55,9 +55,9 @@ class TagHelperNode(Node):
|
||||
) -> None: ...
|
||||
def get_resolved_arguments(
|
||||
self, context: Context
|
||||
) -> Union[
|
||||
Tuple[Dict[Any, Any], Dict[Any, Any]],
|
||||
Tuple[List[int], Dict[str, Union[SafeText, int]]],
|
||||
) -> Tuple[
|
||||
Union[Dict[str, Union[SafeText, int]], List[Union[Context, int]]],
|
||||
Union[Dict[Any, Any], Dict[str, Union[SafeText, int]], Dict[str, int]],
|
||||
]: ...
|
||||
|
||||
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 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.core.paginator import Page, Paginator
|
||||
from django.db.models.base import Model
|
||||
from django.db.models.query import QuerySet
|
||||
from django.forms.forms import BaseForm
|
||||
from django.http import HttpResponse
|
||||
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.views.generic.base import TemplateResponseMixin
|
||||
from django.views.generic.detail import DetailView
|
||||
from django.views.generic.list import (ListView,
|
||||
MultipleObjectTemplateResponseMixin)
|
||||
from django.views.generic.list import ListView
|
||||
|
||||
from .loader import get_template, select_template
|
||||
|
||||
@@ -38,19 +38,17 @@ class SimpleTemplateResponse(HttpResponse):
|
||||
template: Union[List[str], Template, str],
|
||||
context: Optional[
|
||||
Union[
|
||||
Dict[
|
||||
str, Optional[Union[List[Dict[str, str]], bool, ListView]]
|
||||
],
|
||||
Dict[str, Any],
|
||||
Dict[str, List[Dict[str, Any]]],
|
||||
Dict[
|
||||
str,
|
||||
Optional[
|
||||
Union[
|
||||
List[
|
||||
Dict[str, Optional[Union[datetime, Model, str]]]
|
||||
],
|
||||
bool,
|
||||
date,
|
||||
Page,
|
||||
Paginator,
|
||||
QuerySet,
|
||||
MultipleObjectTemplateResponseMixin,
|
||||
ListView,
|
||||
]
|
||||
],
|
||||
],
|
||||
@@ -59,17 +57,12 @@ class SimpleTemplateResponse(HttpResponse):
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
List[Dict[str, Optional[Union[datetime, Model, str]]]],
|
||||
bool,
|
||||
Page,
|
||||
Paginator,
|
||||
ListView,
|
||||
List[Dict[str, str]], bool, Page, Paginator, ListView
|
||||
],
|
||||
],
|
||||
Dict[str, Union[List[str], str]],
|
||||
Dict[
|
||||
str,
|
||||
Union[RequestSite, BaseForm, TemplateResponseMixin, str],
|
||||
str, Union[AuthenticationForm, LoginView, RequestSite, str]
|
||||
],
|
||||
Dict[str, Union[Model, BaseForm, TemplateResponseMixin, str]],
|
||||
MagicMock,
|
||||
@@ -87,19 +80,17 @@ class SimpleTemplateResponse(HttpResponse):
|
||||
self,
|
||||
context: Optional[
|
||||
Union[
|
||||
Dict[
|
||||
str, Optional[Union[List[Dict[str, str]], bool, ListView]]
|
||||
],
|
||||
Dict[str, Any],
|
||||
Dict[str, List[Dict[str, Any]]],
|
||||
Dict[
|
||||
str,
|
||||
Optional[
|
||||
Union[
|
||||
List[
|
||||
Dict[str, Optional[Union[datetime, Model, str]]]
|
||||
],
|
||||
bool,
|
||||
date,
|
||||
Page,
|
||||
Paginator,
|
||||
QuerySet,
|
||||
MultipleObjectTemplateResponseMixin,
|
||||
ListView,
|
||||
]
|
||||
],
|
||||
],
|
||||
@@ -108,17 +99,12 @@ class SimpleTemplateResponse(HttpResponse):
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
List[Dict[str, Optional[Union[datetime, Model, str]]]],
|
||||
bool,
|
||||
Page,
|
||||
Paginator,
|
||||
ListView,
|
||||
List[Dict[str, str]], bool, Page, Paginator, ListView
|
||||
],
|
||||
],
|
||||
Dict[str, Union[List[str], str]],
|
||||
Dict[
|
||||
str,
|
||||
Union[RequestSite, BaseForm, TemplateResponseMixin, str],
|
||||
str, Union[AuthenticationForm, LoginView, RequestSite, str]
|
||||
],
|
||||
Dict[str, Union[Model, BaseForm, TemplateResponseMixin, str]],
|
||||
MagicMock,
|
||||
@@ -126,17 +112,15 @@ class SimpleTemplateResponse(HttpResponse):
|
||||
],
|
||||
) -> Optional[
|
||||
Union[
|
||||
Dict[str, Optional[Union[List[Dict[str, str]], bool, ListView]]],
|
||||
Dict[str, Any],
|
||||
Dict[str, List[Dict[str, Any]]],
|
||||
Dict[
|
||||
str,
|
||||
Optional[
|
||||
Union[
|
||||
List[Dict[str, Optional[Union[datetime, Model, str]]]],
|
||||
bool,
|
||||
date,
|
||||
Page,
|
||||
Paginator,
|
||||
QuerySet,
|
||||
MultipleObjectTemplateResponseMixin,
|
||||
ListView,
|
||||
]
|
||||
],
|
||||
],
|
||||
@@ -144,16 +128,10 @@ class SimpleTemplateResponse(HttpResponse):
|
||||
Dict[str, Union[Dict[str, str], DetailView]],
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
List[Dict[str, Optional[Union[datetime, Model, str]]]],
|
||||
bool,
|
||||
Page,
|
||||
Paginator,
|
||||
ListView,
|
||||
],
|
||||
Union[List[Dict[str, str]], bool, Page, Paginator, ListView],
|
||||
],
|
||||
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]],
|
||||
MagicMock,
|
||||
]
|
||||
@@ -177,29 +155,29 @@ class TemplateResponse(SimpleTemplateResponse):
|
||||
context: django.template.context.RequestContext
|
||||
context_data: Optional[
|
||||
Union[
|
||||
Dict[str, Any],
|
||||
Dict[str, List[Dict[str, Any]]],
|
||||
Dict[
|
||||
str,
|
||||
Optional[
|
||||
Union[
|
||||
List[Dict[str, str]],
|
||||
List[
|
||||
Dict[
|
||||
str,
|
||||
Optional[
|
||||
Union[
|
||||
datetime.datetime,
|
||||
django.db.models.base.Model,
|
||||
str,
|
||||
]
|
||||
],
|
||||
]
|
||||
],
|
||||
bool,
|
||||
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,
|
||||
@@ -208,18 +186,7 @@ class TemplateResponse(SimpleTemplateResponse):
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
List[
|
||||
Dict[
|
||||
str,
|
||||
Optional[
|
||||
Union[
|
||||
datetime.datetime,
|
||||
django.db.models.base.Model,
|
||||
str,
|
||||
]
|
||||
],
|
||||
]
|
||||
],
|
||||
List[Dict[str, str]],
|
||||
bool,
|
||||
django.core.paginator.Page,
|
||||
django.core.paginator.Paginator,
|
||||
@@ -230,9 +197,9 @@ class TemplateResponse(SimpleTemplateResponse):
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
django.contrib.auth.forms.AuthenticationForm,
|
||||
django.contrib.auth.views.LoginView,
|
||||
django.contrib.sites.requests.RequestSite,
|
||||
django.forms.forms.BaseForm,
|
||||
django.views.generic.base.TemplateResponseMixin,
|
||||
str,
|
||||
],
|
||||
],
|
||||
@@ -268,19 +235,17 @@ class TemplateResponse(SimpleTemplateResponse):
|
||||
template: Union[List[str], Template, str],
|
||||
context: Optional[
|
||||
Union[
|
||||
Dict[
|
||||
str, Optional[Union[List[Dict[str, str]], bool, ListView]]
|
||||
],
|
||||
Dict[str, Any],
|
||||
Dict[str, List[Dict[str, Any]]],
|
||||
Dict[
|
||||
str,
|
||||
Optional[
|
||||
Union[
|
||||
List[
|
||||
Dict[str, Optional[Union[datetime, Model, str]]]
|
||||
],
|
||||
bool,
|
||||
date,
|
||||
Page,
|
||||
Paginator,
|
||||
QuerySet,
|
||||
MultipleObjectTemplateResponseMixin,
|
||||
ListView,
|
||||
]
|
||||
],
|
||||
],
|
||||
@@ -289,17 +254,12 @@ class TemplateResponse(SimpleTemplateResponse):
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
List[Dict[str, Optional[Union[datetime, Model, str]]]],
|
||||
bool,
|
||||
Page,
|
||||
Paginator,
|
||||
ListView,
|
||||
List[Dict[str, str]], bool, Page, Paginator, ListView
|
||||
],
|
||||
],
|
||||
Dict[str, Union[List[str], str]],
|
||||
Dict[
|
||||
str,
|
||||
Union[RequestSite, BaseForm, TemplateResponseMixin, str],
|
||||
str, Union[AuthenticationForm, LoginView, RequestSite, str]
|
||||
],
|
||||
Dict[str, Union[Model, BaseForm, TemplateResponseMixin, str]],
|
||||
MagicMock,
|
||||
|
||||
@@ -8,8 +8,8 @@ from django.utils.safestring import SafeText
|
||||
|
||||
register: Any
|
||||
|
||||
def localize(value: Union[date, float, int]) -> str: ...
|
||||
def unlocalize(value: Union[date, float, int]) -> str: ...
|
||||
def localize(value: Union[date, float]) -> str: ...
|
||||
def unlocalize(value: Union[date, float]) -> str: ...
|
||||
|
||||
class LocalizeNode(Node):
|
||||
origin: django.template.base.Origin
|
||||
|
||||
@@ -14,7 +14,6 @@ from django.http.response import (HttpResponse, HttpResponseBase,
|
||||
HttpResponseRedirect)
|
||||
from django.template.base import Template
|
||||
from django.template.context import Context
|
||||
from django.test.utils import ContextList
|
||||
|
||||
|
||||
class RedirectCycleError(Exception):
|
||||
@@ -36,28 +35,7 @@ class ClientHandler(BaseHandler):
|
||||
def __init__(
|
||||
self, enforce_csrf_checks: bool = ..., *args: Any, **kwargs: Any
|
||||
) -> None: ...
|
||||
def __call__(
|
||||
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 __call__(self, environ: Dict[str, Any]) -> HttpResponseBase: ...
|
||||
|
||||
def encode_multipart(
|
||||
boundary: str,
|
||||
@@ -80,18 +58,7 @@ def encode_multipart(
|
||||
Dict[str, SimpleUploadedFile],
|
||||
],
|
||||
) -> bytes: ...
|
||||
def encode_file(
|
||||
boundary: str,
|
||||
key: str,
|
||||
file: Union[
|
||||
BufferedRandom,
|
||||
BufferedReader,
|
||||
BytesIO,
|
||||
StringIO,
|
||||
SimpleUploadedFile,
|
||||
_TemporaryFileWrapper,
|
||||
],
|
||||
) -> List[bytes]: ...
|
||||
def encode_file(boundary: str, key: str, file: Any) -> List[bytes]: ...
|
||||
|
||||
class RequestFactory:
|
||||
json_encoder: Type[django.core.serializers.json.DjangoJSONEncoder] = ...
|
||||
|
||||
@@ -7,14 +7,12 @@ def normalize_whitespace(string: str) -> str: ...
|
||||
|
||||
class Element:
|
||||
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]] = ...
|
||||
def __init__(
|
||||
self,
|
||||
name: Optional[str],
|
||||
attributes: Union[
|
||||
List[Union[Tuple[str, None], Tuple[str, str]]], Tuple
|
||||
],
|
||||
attributes: Union[List[Tuple[str, Optional[str]]], Tuple],
|
||||
) -> None: ...
|
||||
def append(self, element: Union[Element, str]) -> None: ...
|
||||
def finalize(self) -> None: ...
|
||||
@@ -45,10 +43,10 @@ class Parser(HTMLParser):
|
||||
@property
|
||||
def current(self) -> Element: ...
|
||||
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: ...
|
||||
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: ...
|
||||
def handle_endtag(self, tag: str) -> None: ...
|
||||
def handle_data(self, data: str) -> None: ...
|
||||
|
||||
@@ -14,20 +14,10 @@ class DebugSQLTextTestResult(unittest.TextTestResult):
|
||||
buffer: bool
|
||||
descriptions: bool
|
||||
dots: bool
|
||||
errors: List[
|
||||
Union[
|
||||
Tuple[django.test.testcases.TestCase, str, str],
|
||||
Tuple[unittest.case._SubTest, str, str],
|
||||
]
|
||||
]
|
||||
errors: List[Tuple[unittest.case.TestCase, str, str]]
|
||||
expectedFailures: List[Any]
|
||||
failfast: bool
|
||||
failures: List[
|
||||
Union[
|
||||
Tuple[django.test.testcases.TestCase, str, str],
|
||||
Tuple[unittest.case._SubTest, str, str],
|
||||
]
|
||||
]
|
||||
failures: List[Tuple[unittest.case.TestCase, str, str]]
|
||||
shouldStop: bool
|
||||
showAll: bool
|
||||
skipped: List[Any]
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
import threading
|
||||
import unittest
|
||||
from contextlib import _GeneratorContextManager
|
||||
from datetime import date, time, timedelta
|
||||
from decimal import Decimal
|
||||
from datetime import date
|
||||
from typing import (Any, Callable, Dict, Iterator, List, Optional, Set, Tuple,
|
||||
Type, Union)
|
||||
from unittest.runner import TextTestResult
|
||||
from uuid import UUID
|
||||
|
||||
from django.contrib.staticfiles.handlers import StaticFilesHandler
|
||||
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.template.context import Context
|
||||
from django.test.html import Element
|
||||
from django.test.utils import (Approximate, CaptureQueriesContext,
|
||||
modify_settings, override_settings)
|
||||
from django.test.utils import (CaptureQueriesContext, modify_settings,
|
||||
override_settings)
|
||||
from django.utils.deprecation import RemovedInDjango30Warning
|
||||
from django.utils.safestring import SafeText
|
||||
|
||||
@@ -209,45 +207,12 @@ class TransactionTestCase(SimpleTestCase):
|
||||
qs: Union[Iterator[Any], List[Model], QuerySet, RawQuerySet],
|
||||
values: Union[
|
||||
List[Optional[str]],
|
||||
List[Tuple[Any, Any]],
|
||||
List[Tuple[Model, Model]],
|
||||
List[Tuple[Model, int, 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[int],
|
||||
Set[str],
|
||||
QuerySet,
|
||||
],
|
||||
|
||||
@@ -7,21 +7,14 @@ from typing import (Any, Callable, Dict, Iterator, List, Optional, Set, Tuple,
|
||||
|
||||
from django.apps.registry import Apps
|
||||
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.backends.base.base import BaseDatabaseWrapper
|
||||
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.context import Context
|
||||
from django.test.runner import DiscoverRunner
|
||||
from django.test.testcases import SimpleTestCase
|
||||
from django.utils.safestring import SafeText
|
||||
from django.views.generic.detail import SingleObjectTemplateResponseMixin
|
||||
|
||||
|
||||
class Approximate:
|
||||
@@ -33,23 +26,7 @@ class Approximate:
|
||||
def __eq__(self, other: Union[Decimal, float]) -> bool: ...
|
||||
|
||||
class ContextList(list):
|
||||
def __getitem__(
|
||||
self, key: Union[int, str]
|
||||
) -> Optional[
|
||||
Union[
|
||||
List[Union[List[str], str]],
|
||||
bool,
|
||||
AdminForm,
|
||||
ChangeList,
|
||||
FallbackStorage,
|
||||
Model,
|
||||
BaseForm,
|
||||
Media,
|
||||
Context,
|
||||
SingleObjectTemplateResponseMixin,
|
||||
str,
|
||||
]
|
||||
]: ...
|
||||
def __getitem__(self, key: Union[int, str]) -> Any: ...
|
||||
def get(self, key: str, default: Optional[str] = ...) -> str: ...
|
||||
def __contains__(self, key: str) -> bool: ...
|
||||
def keys(self) -> Set[str]: ...
|
||||
@@ -60,7 +37,7 @@ def setup_test_environment(debug: Optional[bool] = ...) -> None: ...
|
||||
def teardown_test_environment() -> None: ...
|
||||
def get_runner(
|
||||
settings: LazySettings, test_runner_class: Optional[str] = ...
|
||||
) -> Type[Union[Any, DiscoverRunner]]: ...
|
||||
) -> Type[DiscoverRunner]: ...
|
||||
|
||||
class TestContextDecorator:
|
||||
attr_name: Any = ...
|
||||
@@ -95,35 +72,45 @@ class override_settings(TestContextDecorator):
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
Dict[str, Optional[str]],
|
||||
Dict[str, Union[Callable, Dict[str, int], str]],
|
||||
Dict[str, Union[Dict[str, int], int, str]],
|
||||
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]
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
Dict[
|
||||
str,
|
||||
List[
|
||||
Dict[
|
||||
str, Union[Dict[str, List[Tuple[str, Dict[str, str]]]], str]
|
||||
]
|
||||
],
|
||||
],
|
||||
Dict[
|
||||
str,
|
||||
List[
|
||||
Union[
|
||||
Dict[str, Union[Dict[Any, Any], bool, str]],
|
||||
Dict[str, Union[Dict[str, bool], bool, str]],
|
||||
]
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
Dict[str, Union[Callable, Dict[str, int], str]],
|
||||
Dict[str, Union[Dict[str, int], int, str]],
|
||||
],
|
||||
],
|
||||
],
|
||||
Dict[str, List[Dict[str, Union[Dict[Any, Any], bool, str]]]],
|
||||
Dict[
|
||||
str,
|
||||
List[
|
||||
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[bool, str]],
|
||||
]
|
||||
],
|
||||
],
|
||||
@@ -131,16 +118,7 @@ class override_settings(TestContextDecorator):
|
||||
str,
|
||||
List[
|
||||
Union[
|
||||
Dict[str, Union[Dict[str, 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, int], bool, str]],
|
||||
Dict[str, Union[Dict[str, str], str]],
|
||||
]
|
||||
],
|
||||
@@ -152,69 +130,25 @@ class override_settings(TestContextDecorator):
|
||||
Dict[str, Type[Any]],
|
||||
Dict[str, Union[Callable, 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[
|
||||
str,
|
||||
Union[
|
||||
Dict[
|
||||
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, Dict[str, Optional[str]]], List[Tuple[str, str]], str
|
||||
],
|
||||
],
|
||||
Dict[str, Union[Dict[str, Optional[str]], List[str]]],
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
Dict[str, Dict[str, Union[List[str], bool, str]]],
|
||||
Dict[str, Dict[str, str]],
|
||||
int,
|
||||
Dict[str, Dict[str, Union[List[str], bool, str]]], int
|
||||
],
|
||||
],
|
||||
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[
|
||||
str,
|
||||
Union[
|
||||
@@ -224,13 +158,15 @@ class override_settings(TestContextDecorator):
|
||||
Dict[str, Union[Callable, str]],
|
||||
Dict[str, Union[Dict[str, int], str]],
|
||||
Dict[str, Union[int, str]],
|
||||
Dict[str, str],
|
||||
],
|
||||
],
|
||||
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[
|
||||
str,
|
||||
Union[
|
||||
@@ -240,6 +176,17 @@ class override_settings(TestContextDecorator):
|
||||
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[
|
||||
str,
|
||||
Union[
|
||||
@@ -271,7 +218,7 @@ class modify_settings(override_settings):
|
||||
kwarg_name: None
|
||||
wrapped: Union[django.conf.Settings, django.conf.UserSettingsHolder]
|
||||
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 save_options(self, test_func: Type[SimpleTestCase]) -> None: ...
|
||||
|
||||
@@ -18,7 +18,7 @@ def get_conditional_response(
|
||||
response: Optional[HttpResponse] = ...,
|
||||
) -> Optional[HttpResponse]: ...
|
||||
def patch_response_headers(
|
||||
response: HttpResponseBase, cache_timeout: Union[float, int] = ...
|
||||
response: HttpResponseBase, cache_timeout: float = ...
|
||||
) -> None: ...
|
||||
def add_never_cache_headers(response: HttpResponseBase) -> None: ...
|
||||
def patch_vary_headers(
|
||||
@@ -29,12 +29,14 @@ def get_cache_key(
|
||||
request: WSGIRequest,
|
||||
key_prefix: Optional[str] = ...,
|
||||
method: str = ...,
|
||||
cache: Optional[Union[DefaultCacheProxy, BaseCache]] = ...,
|
||||
cache: Optional[Union[DefaultCacheProxy, backends.base.BaseCache]] = ...,
|
||||
) -> Optional[str]: ...
|
||||
def learn_cache_key(
|
||||
request: WSGIRequest,
|
||||
response: HttpResponse,
|
||||
cache_timeout: Optional[Union[float, int]] = ...,
|
||||
cache_timeout: Optional[float] = ...,
|
||||
key_prefix: Optional[str] = ...,
|
||||
cache: Optional[Union[DefaultCacheProxy, LocMemCache]] = ...,
|
||||
cache: Optional[
|
||||
Union[DefaultCacheProxy, backends.locmem.LocMemCache]
|
||||
] = ...,
|
||||
) -> str: ...
|
||||
|
||||
@@ -5,14 +5,13 @@ from typing import (Any, Callable, Dict, Iterator, List, Optional, Tuple, Type,
|
||||
from unittest.case import TestCase
|
||||
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.db.models.base import Model
|
||||
from django.db.models.expressions import Combinable
|
||||
from django.test.testcases import SerializeMixin
|
||||
from django.test.utils import LoggingCaptureMixin
|
||||
from django.urls.converters import (IntConverter, PathConverter, SlugConverter,
|
||||
StringConverter, UUIDConverter)
|
||||
from django.urls.converters import IntConverter, StringConverter, UUIDConverter
|
||||
|
||||
|
||||
class OrderedSet:
|
||||
@@ -23,8 +22,9 @@ class OrderedSet:
|
||||
Union[
|
||||
List[Optional[int]],
|
||||
List[Tuple[str, str]],
|
||||
List[Union[Combinable, str]],
|
||||
List[datetime],
|
||||
List[Combinable],
|
||||
List[str],
|
||||
List[UUID],
|
||||
OrderedDict,
|
||||
]
|
||||
@@ -76,37 +76,27 @@ class MultiValueDict(dict):
|
||||
self, key: Union[Callable, str], default_list: None = ...
|
||||
) -> Union[
|
||||
List[
|
||||
Union[
|
||||
Tuple[
|
||||
List[Tuple[str, List[Any]]],
|
||||
str,
|
||||
Dict[str, Dict[str, Type[Sitemap]]],
|
||||
Dict[Any, Any],
|
||||
],
|
||||
Tuple[
|
||||
List[Tuple[str, List[str]]],
|
||||
str,
|
||||
Dict[str, int],
|
||||
Union[
|
||||
Dict[Any, Any],
|
||||
Dict[str, IntConverter],
|
||||
Dict[str, PathConverter],
|
||||
Dict[str, SlugConverter],
|
||||
Dict[str, StringConverter],
|
||||
Dict[str, UUIDConverter],
|
||||
],
|
||||
],
|
||||
Tuple[
|
||||
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],
|
||||
],
|
||||
],
|
||||
Tuple[
|
||||
List[Tuple[str, List[str]]],
|
||||
str,
|
||||
Dict[str, Dict[str, GenericSitemap]],
|
||||
Dict[str, Any],
|
||||
]
|
||||
],
|
||||
List[
|
||||
Tuple[
|
||||
List[Tuple[str, List[str]]],
|
||||
str,
|
||||
Dict[str, Union[Dict[str, Type[Sitemap]], str]],
|
||||
Union[Dict[str, StringConverter], Dict[str, UUIDConverter]],
|
||||
]
|
||||
],
|
||||
List[
|
||||
Tuple[
|
||||
List[Tuple[str, List[str]]],
|
||||
str,
|
||||
Dict[str, int],
|
||||
Union[Dict[str, IntConverter], Dict[str, StringConverter]],
|
||||
]
|
||||
],
|
||||
List[UploadedFile],
|
||||
@@ -116,23 +106,19 @@ class MultiValueDict(dict):
|
||||
self,
|
||||
key: Union[Callable, str],
|
||||
value: Union[
|
||||
Tuple[
|
||||
List[Tuple[str, List[Any]]],
|
||||
str,
|
||||
Dict[str, Dict[str, Sitemap]],
|
||||
Dict[Any, Any],
|
||||
],
|
||||
Tuple[
|
||||
List[Tuple[str, List[str]]],
|
||||
str,
|
||||
Dict[str, Union[int, str]],
|
||||
Dict[str, Union[IntConverter, StringConverter]],
|
||||
],
|
||||
Tuple[
|
||||
List[Union[Tuple[str, List[Any]], Tuple[str, List[str]]]],
|
||||
str,
|
||||
Dict[str, Union[Dict[str, Type[Sitemap]], str]],
|
||||
Dict[str, UUIDConverter],
|
||||
Union[
|
||||
Dict[Any, Any],
|
||||
Dict[str, Any],
|
||||
Dict[str, Union[IntConverter, StringConverter]],
|
||||
],
|
||||
Union[
|
||||
Dict[str, Any],
|
||||
Dict[str, Union[IntConverter, StringConverter]],
|
||||
Dict[str, UUIDConverter],
|
||||
],
|
||||
],
|
||||
UploadedFile,
|
||||
str,
|
||||
|
||||
@@ -36,16 +36,13 @@ def decorator_from_middleware_with_args(
|
||||
) -> Callable: ...
|
||||
def decorator_from_middleware(
|
||||
middleware_class: Type[
|
||||
Union[
|
||||
Any, XViewMiddleware, CsrfViewMiddleware, ConditionalGetMiddleware
|
||||
]
|
||||
Union[XViewMiddleware, CsrfViewMiddleware, ConditionalGetMiddleware]
|
||||
]
|
||||
) -> Callable: ...
|
||||
def available_attrs(fn: Any): ...
|
||||
def make_middleware_decorator(
|
||||
middleware_class: Type[
|
||||
Union[
|
||||
Any,
|
||||
XViewMiddleware,
|
||||
CacheMiddleware,
|
||||
CsrfViewMiddleware,
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
from datetime import date, time, timedelta
|
||||
from decimal import Decimal
|
||||
from typing import Any, Dict, Optional, Union
|
||||
from uuid import UUID
|
||||
from datetime import date
|
||||
from typing import Any, Optional, Union
|
||||
|
||||
from django.db.models.base import Model
|
||||
from django.db.models.fields.files import FieldFile
|
||||
|
||||
|
||||
class DjangoUnicodeDecodeError(UnicodeDecodeError):
|
||||
@@ -19,22 +16,7 @@ def smart_text(
|
||||
strings_only: bool = ...,
|
||||
errors: str = ...,
|
||||
) -> str: ...
|
||||
def is_protected_type(
|
||||
obj: Optional[
|
||||
Union[
|
||||
date,
|
||||
time,
|
||||
timedelta,
|
||||
Decimal,
|
||||
FieldFile,
|
||||
float,
|
||||
int,
|
||||
memoryview,
|
||||
str,
|
||||
UUID,
|
||||
]
|
||||
]
|
||||
) -> bool: ...
|
||||
def is_protected_type(obj: Any) -> bool: ...
|
||||
def force_text(
|
||||
s: Optional[Union[bytes, Model, int, str]],
|
||||
encoding: str = ...,
|
||||
@@ -48,12 +30,7 @@ def smart_bytes(
|
||||
errors: str = ...,
|
||||
) -> bytes: ...
|
||||
def force_bytes(
|
||||
s: Union[
|
||||
Dict[str, str], ValueError, bytes, date, int, memoryview, str, UUID
|
||||
],
|
||||
encoding: str = ...,
|
||||
strings_only: bool = ...,
|
||||
errors: str = ...,
|
||||
s: Any, encoding: str = ..., strings_only: bool = ..., errors: str = ...
|
||||
) -> Union[bytes, date]: ...
|
||||
|
||||
smart_str = smart_text
|
||||
|
||||
@@ -55,10 +55,10 @@ class SyndicationFeed:
|
||||
def item_attributes(
|
||||
self,
|
||||
item: Union[
|
||||
Dict[str, Any],
|
||||
Dict[
|
||||
str, Optional[Union[List[Enclosure], List[str], datetime, str]]
|
||||
],
|
||||
Dict[str, Optional[Union[List[str], Tuple, bool, datetime, str]]],
|
||||
],
|
||||
) -> Dict[Any, Any]: ...
|
||||
def add_item_elements(self, handler: Any, item: Any) -> None: ...
|
||||
@@ -101,6 +101,7 @@ class Rss201rev2Feed(RssFeed):
|
||||
Dict[str, Optional[Union[Tuple, str]]],
|
||||
]
|
||||
items: Union[
|
||||
List[Dict[str, Any]],
|
||||
List[
|
||||
Dict[
|
||||
str,
|
||||
@@ -114,21 +115,15 @@ class Rss201rev2Feed(RssFeed):
|
||||
],
|
||||
]
|
||||
],
|
||||
List[
|
||||
Dict[
|
||||
str,
|
||||
Optional[Union[List[str], Tuple, bool, datetime.datetime, str]],
|
||||
]
|
||||
],
|
||||
]
|
||||
def add_item_elements(
|
||||
self,
|
||||
handler: SimplerXMLGenerator,
|
||||
item: Union[
|
||||
Dict[str, Any],
|
||||
Dict[
|
||||
str, Optional[Union[List[Enclosure], List[str], datetime, str]]
|
||||
],
|
||||
Dict[str, Optional[Union[List[str], Tuple, bool, datetime, str]]],
|
||||
],
|
||||
) -> None: ...
|
||||
|
||||
|
||||
@@ -1,18 +1,6 @@
|
||||
from datetime import date, time
|
||||
from decimal import Decimal
|
||||
from typing import Any, Dict, Iterator, List, Optional, Tuple, 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
|
||||
from typing import Any, Iterator, List, Optional, Union
|
||||
|
||||
ISO_INPUT_FORMATS: Any
|
||||
FORMAT_SETTINGS: Any
|
||||
@@ -41,70 +29,14 @@ def time_format(
|
||||
use_l10n: None = ...,
|
||||
) -> str: ...
|
||||
def number_format(
|
||||
value: Union[Decimal, float, int, str],
|
||||
value: Union[Decimal, float, str],
|
||||
decimal_pos: Optional[int] = ...,
|
||||
use_l10n: Optional[bool] = ...,
|
||||
force_grouping: bool = ...,
|
||||
) -> str: ...
|
||||
def localize(
|
||||
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(value: Any, use_l10n: Optional[bool] = ...) -> Any: ...
|
||||
def localize_input(
|
||||
value: Optional[Union[date, time, Decimal, float, int, str]],
|
||||
default: Optional[str] = ...,
|
||||
value: Any, default: Optional[str] = ...
|
||||
) -> Optional[str]: ...
|
||||
def sanitize_separators(
|
||||
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 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.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): ...
|
||||
@@ -67,139 +10,7 @@ class cached_property:
|
||||
__doc__: Any = ...
|
||||
name: str = ...
|
||||
def __init__(self, func: Callable, name: Optional[str] = ...) -> None: ...
|
||||
def __get__(
|
||||
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,
|
||||
]
|
||||
]: ...
|
||||
def __get__(self, instance: Any, cls: Type[Any] = ...) -> Any: ...
|
||||
|
||||
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.fields.files import FieldFile
|
||||
from django.forms.utils import ErrorList
|
||||
from django.utils.safestring import SafeText
|
||||
|
||||
TRAILING_PUNCTUATION_CHARS: str
|
||||
@@ -19,9 +18,7 @@ def escapejs(value: str) -> SafeText: ...
|
||||
def json_script(
|
||||
value: Union[Dict[str, str], str], element_id: str
|
||||
) -> SafeText: ...
|
||||
def conditional_escape(
|
||||
text: Optional[Union[Model, FieldFile, ErrorList, int, str]]
|
||||
) -> str: ...
|
||||
def conditional_escape(text: Any) -> str: ...
|
||||
def format_html(format_string: str, *args: Any, **kwargs: Any) -> SafeText: ...
|
||||
def format_html_join(
|
||||
sep: str,
|
||||
|
||||
@@ -24,21 +24,21 @@ def urlencode(
|
||||
Dict[str, bytearray],
|
||||
Dict[str, bytes],
|
||||
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]],
|
||||
str,
|
||||
],
|
||||
doseq: bool = ...,
|
||||
) -> 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_safe(date: str) -> Optional[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: ...
|
||||
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: ...
|
||||
def urlsafe_base64_encode(s: bytes) -> 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_full_args(
|
||||
func: Callable
|
||||
) -> List[Union[Tuple[str, int], Tuple[str, str], Tuple[str]]]: ...
|
||||
def get_func_full_args(func: Callable) -> List[Tuple[str]]: ...
|
||||
def func_accepts_kwargs(func: Callable) -> bool: ...
|
||||
def func_accepts_var_args(func: Callable) -> bool: ...
|
||||
def func_has_no_args(func: Any): ...
|
||||
|
||||
@@ -15,7 +15,7 @@ def is_iterable(
|
||||
]
|
||||
],
|
||||
List[Tuple[int, int, int]],
|
||||
List[Union[List[Union[List[List[str]], str]], CheckMessage]],
|
||||
List[CheckMessage],
|
||||
List[int],
|
||||
List[str],
|
||||
Tuple[
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user