third iteration of stubs

This commit is contained in:
Maxim Kurnikov
2018-08-11 00:19:50 +03:00
parent fa718b8e55
commit c6bceb19f4
216 changed files with 16306 additions and 3006 deletions
+56 -16
View File
@@ -1,6 +1,12 @@
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.uploadedfile import SimpleUploadedFile
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
@@ -10,7 +16,18 @@ from django.utils.safestring import SafeText
class BoundField:
initial: Any
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,
]
]
form: django.forms.forms.BaseForm = ...
field: django.forms.fields.Field = ...
name: str = ...
@@ -25,8 +42,8 @@ class BoundField:
def __iter__(self): ...
def __len__(self) -> int: ...
def __getitem__(
self, idx: Union[slice, str, int]
) -> Union[BoundWidget, List[BoundWidget]]: ...
self, idx: Union[int, slice, str]
) -> Union[List[BoundWidget], BoundWidget]: ...
@property
def errors(self) -> ErrorList: ...
def as_widget(
@@ -36,15 +53,26 @@ class BoundField:
only_initial: bool = ...,
) -> SafeText: ...
def as_text(self, attrs: None = ..., **kwargs: Any) -> SafeText: ...
def as_textarea(self, attrs: Optional[Any] = ..., **kwargs: Any): ...
def as_textarea(self, attrs: None = ..., **kwargs: Any) -> SafeText: ...
def as_hidden(self, attrs: None = ..., **kwargs: Any) -> SafeText: ...
@property
def data(
def data(self) -> Any: ...
def value(
self
) -> Optional[
Union[bool, SimpleUploadedFile, List[Union[str, List[str]]], str]
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] = ...,
@@ -58,7 +86,24 @@ class BoundField:
def auto_id(self) -> str: ...
@property
def id_for_label(self) -> str: ...
def initial(self) -> Any: ...
def initial(
self
) -> Optional[
Union[
List[Union[int, str]],
List[Model],
date,
time,
timedelta,
Model,
FieldFile,
QuerySet,
float,
int,
str,
UUID,
]
]: ...
def build_widget_attrs(
self, attrs: Dict[str, str], widget: Optional[Widget] = ...
) -> Dict[str, Union[bool, str]]: ...
@@ -66,18 +111,13 @@ class BoundField:
class BoundWidget:
parent_widget: django.forms.widgets.Widget = ...
data: Dict[
str, Optional[Union[str, bool, Dict[str, bool], Dict[Any, Any]]]
str, Optional[Union[Dict[str, Union[bool, str]], int, str]]
] = ...
renderer: django.forms.renderers.DjangoTemplates = ...
def __init__(
self,
parent_widget: Widget,
data: Dict[
str,
Optional[
Union[str, bool, Dict[str, bool], Dict[str, Union[bool, str]]]
],
],
data: Dict[str, Optional[Union[Dict[str, Union[bool, str]], int, str]]],
renderer: DjangoTemplates,
) -> None: ...
def tag(self, wrap_label: bool = ...) -> SafeText: ...
+573 -81
View File
@@ -1,12 +1,30 @@
from collections import OrderedDict
from datetime import date, datetime, time
from datetime import date, datetime, time, timedelta
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.widgets import Widget
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)
class Field:
@@ -40,36 +58,351 @@ class Field:
disabled: bool = ...,
label_suffix: Optional[Any] = ...
) -> None: ...
def prepare_value(self, value: Any) -> Any: ...
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[bool, List[str], List[None], str]]
) -> Optional[Union[bool, List[str], List[None], str]]: ...
def validate(self, value: Optional[Union[Model, int, str]]) -> None: ...
def run_validators(self, value: Any) -> None: ...
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[List[int], int, str]]
) -> Optional[Union[Model, int, str]]: ...
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[str, bool, List[str]]],
initial: Optional[Union[int, str, datetime]],
) -> Optional[Union[str, bool, List[str]]]: ...
data: Optional[
Union[List[Union[List[str], str]], datetime, Decimal, int, str]
],
initial: Optional[Union[List[str], date, float, int, str, UUID]],
) -> Optional[
Union[List[Union[List[str], str]], date, Decimal, int, str]
]: ...
def widget_attrs(self, widget: Widget) -> Dict[Any, Any]: ...
def has_changed(
self,
initial: Optional[Union[time, int, date, str]],
initial: Optional[Union[date, time, Decimal, float, int, str]],
data: Optional[str],
) -> bool: ...
def get_bound_field(
self, form: BaseForm, field_name: str
) -> BoundField: ...
def __deepcopy__(self, memo: Dict[int, Any]) -> Field: ...
def __deepcopy__(
self,
memo: Union[
Dict[
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]
],
OrderedDict,
Field,
Widget,
],
],
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]],
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,
],
],
],
) -> Field: ...
class CharField(Field):
disabled: bool
error_messages: Dict[str, str]
help_text: str
initial: Optional[Union[str, Callable]]
initial: Optional[Union[Callable, str]]
label: Optional[str]
label_suffix: Optional[str]
localize: bool
@@ -77,13 +410,14 @@ class CharField(Field):
show_hidden_initial: bool
validators: List[
Union[
django.core.validators.BaseValidator,
django.core.validators.MaxLengthValidator,
django.core.validators.MinLengthValidator,
django.core.validators.ProhibitNullCharactersValidator,
]
]
widget: django.forms.widgets.TextInput
max_length: Optional[Union[str, int]] = ...
min_length: Optional[Union[str, int]] = ...
max_length: Optional[Union[int, str]] = ...
min_length: Optional[Union[int, str]] = ...
strip: bool = ...
empty_value: Optional[str] = ...
def __init__(
@@ -96,7 +430,7 @@ class CharField(Field):
**kwargs: Any
) -> None: ...
def to_python(
self, value: Optional[Union[str, List[int], int]]
self, value: Optional[Union[List[int], Tuple, int, str]]
) -> Optional[str]: ...
def widget_attrs(self, widget: Widget) -> Dict[str, str]: ...
@@ -112,7 +446,12 @@ class IntegerField(Field):
min_value: Optional[int]
required: bool
show_hidden_initial: bool
validators: List[django.core.validators.BaseValidator]
validators: List[
Union[
django.core.validators.MaxValueValidator,
django.core.validators.MinValueValidator,
]
]
widget: django.forms.widgets.NumberInput = ...
default_error_messages: Any = ...
re_decimal: Any = ...
@@ -123,8 +462,12 @@ class IntegerField(Field):
min_value: Optional[Any] = ...,
**kwargs: Any
) -> None: ...
def to_python(self, value: str) -> int: ...
def widget_attrs(self, widget: Widget) -> Dict[Any, Any]: ...
def to_python(
self, value: Optional[Union[float, int, str]]
) -> Optional[int]: ...
def widget_attrs(
self, widget: Widget
) -> Union[Dict[str, Decimal], Dict[str, float], Dict[str, int]]: ...
class FloatField(IntegerField):
disabled: bool
@@ -134,16 +477,25 @@ class FloatField(IntegerField):
label: Optional[str]
label_suffix: None
localize: bool
max_value: Optional[float]
min_value: Optional[float]
max_value: Optional[Union[float, int]]
min_value: Optional[Union[float, int]]
required: bool
show_hidden_initial: bool
validators: List[django.core.validators.BaseValidator]
validators: List[
Union[
django.core.validators.MaxValueValidator,
django.core.validators.MinValueValidator,
]
]
widget: django.forms.widgets.NumberInput
default_error_messages: Any = ...
def to_python(self, value: Any): ...
def validate(self, value: Any): ...
def widget_attrs(self, widget: Any): ...
def to_python(
self, value: Optional[Union[float, int, str]]
) -> Optional[float]: ...
def validate(self, value: Optional[float]) -> None: ...
def widget_attrs(
self, widget: Input
) -> Union[Dict[str, Union[float, str]], Dict[str, Union[int, str]]]: ...
class DecimalField(IntegerField):
decimal_places: Optional[int]
@@ -161,8 +513,9 @@ 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
@@ -176,16 +529,20 @@ class DecimalField(IntegerField):
decimal_places: Optional[Any] = ...,
**kwargs: Any
) -> None: ...
def to_python(self, value: Any): ...
def validate(self, value: Any): ...
def widget_attrs(self, widget: Any): ...
def to_python(
self, value: Optional[Union[Decimal, float, str]]
) -> Optional[Decimal]: ...
def validate(self, value: Optional[Decimal]) -> None: ...
def widget_attrs(
self, widget: Widget
) -> Union[Dict[str, Union[Decimal, str]], Dict[str, Union[int, str]]]: ...
class BaseTemporalField(Field):
input_formats: Any = ...
def __init__(
self, *, input_formats: Optional[Any] = ..., **kwargs: Any
) -> None: ...
def to_python(self, value: Any): ...
def to_python(self, value: str) -> Union[date, time]: ...
def strptime(self, value: Any, format: Any) -> None: ...
class DateField(BaseTemporalField):
@@ -202,8 +559,10 @@ class DateField(BaseTemporalField):
widget: django.forms.widgets.DateInput = ...
input_formats: Any = ...
default_error_messages: Any = ...
def to_python(self, value: date) -> date: ...
def strptime(self, value: Any, format: Any): ...
def to_python(
self, value: Optional[Union[date, str]]
) -> Optional[date]: ...
def strptime(self, value: str, format: str) -> date: ...
class TimeField(BaseTemporalField):
disabled: bool
@@ -219,8 +578,10 @@ class TimeField(BaseTemporalField):
widget: django.forms.widgets.TimeInput = ...
input_formats: Any = ...
default_error_messages: Any = ...
def to_python(self, value: time) -> time: ...
def strptime(self, value: Any, format: Any): ...
def to_python(
self, value: Optional[Union[time, str]]
) -> Optional[time]: ...
def strptime(self, value: str, format: str) -> time: ...
class DateTimeField(BaseTemporalField):
disabled: bool
@@ -236,9 +597,13 @@ class DateTimeField(BaseTemporalField):
widget: django.forms.widgets.DateTimeInput = ...
input_formats: Any = ...
default_error_messages: Any = ...
def prepare_value(self, value: Any): ...
def to_python(self, value: Any): ...
def strptime(self, value: Any, format: Any): ...
def prepare_value(
self, value: Optional[datetime]
) -> Optional[datetime]: ...
def to_python(
self, value: Optional[Union[date, str]]
) -> Optional[datetime]: ...
def strptime(self, value: str, format: str) -> datetime: ...
class DurationField(Field):
disabled: bool
@@ -250,8 +615,10 @@ class DurationField(Field):
required: bool
show_hidden_initial: bool
default_error_messages: Any = ...
def prepare_value(self, value: Any): ...
def to_python(self, value: Any): ...
def prepare_value(
self, value: Optional[Union[timedelta, str]]
) -> Optional[str]: ...
def to_python(self, value: Union[int, str]) -> timedelta: ...
class RegexField(CharField):
disabled: bool
@@ -269,13 +636,14 @@ class RegexField(CharField):
strip: bool
validators: List[
Union[
django.core.validators.BaseValidator,
django.core.validators.MaxLengthValidator,
django.core.validators.MinLengthValidator,
django.core.validators.ProhibitNullCharactersValidator,
django.core.validators.RegexValidator,
]
]
widget: django.forms.widgets.TextInput
def __init__(self, regex: Any, **kwargs: Any) -> None: ...
def __init__(self, regex: str, **kwargs: Any) -> None: ...
regex: Any = ...
class EmailField(CharField):
@@ -295,7 +663,8 @@ class EmailField(CharField):
validators: List[
Union[
django.core.validators.EmailValidator,
django.core.validators.BaseValidator,
django.core.validators.MaxLengthValidator,
django.core.validators.MinLengthValidator,
django.core.validators.ProhibitNullCharactersValidator,
]
]
@@ -323,14 +692,20 @@ class FileField(Field):
allow_empty_file: bool = ...,
**kwargs: Any
) -> None: ...
def to_python(self, data: None) -> None: ...
def to_python(
self, data: Optional[Union[SimpleUploadedFile, str]]
) -> Optional[SimpleUploadedFile]: ...
def clean(
self, data: None, initial: Optional[FieldFile] = ...
) -> FieldFile: ...
self, data: Any, initial: Optional[Union[FieldFile, str]] = ...
) -> Optional[Union[bool, File, str]]: ...
def bound_data(
self, data: None, initial: Optional[FieldFile]
) -> Optional[FieldFile]: ...
def has_changed(self, initial: Optional[FieldFile], data: None) -> bool: ...
self, data: Any, initial: Optional[FieldFile]
) -> Optional[Union[File, str]]: ...
def has_changed(
self,
initial: Optional[Union[FieldFile, str]],
data: Optional[Union[Dict[str, str], str]],
) -> bool: ...
class ImageField(FileField):
allow_empty_file: bool
@@ -345,8 +720,10 @@ class ImageField(FileField):
show_hidden_initial: bool
default_validators: Any = ...
default_error_messages: Any = ...
def to_python(self, data: Any): ...
def widget_attrs(self, widget: Any): ...
def to_python(
self, data: Optional[SimpleUploadedFile]
) -> Optional[SimpleUploadedFile]: ...
def widget_attrs(self, widget: Widget) -> Dict[str, str]: ...
class URLField(CharField):
disabled: bool
@@ -364,16 +741,16 @@ class URLField(CharField):
strip: bool
validators: List[
Union[
django.core.validators.URLValidator,
django.core.validators.MaxLengthValidator,
django.core.validators.ProhibitNullCharactersValidator,
django.core.validators.URLValidator,
]
]
widget: django.forms.widgets.URLInput = ...
default_error_messages: Any = ...
default_validators: Any = ...
def __init__(self, **kwargs: Any) -> None: ...
def to_python(self, value: None) -> str: ...
def to_python(self, value: Optional[Union[int, str]]) -> Optional[str]: ...
class BooleanField(Field):
disabled: bool
@@ -387,10 +764,12 @@ class BooleanField(Field):
show_hidden_initial: bool
validators: List[Any]
widget: django.forms.widgets.CheckboxInput = ...
def to_python(self, value: Optional[Union[str, int]]) -> bool: ...
def to_python(self, value: Optional[Union[int, str]]) -> bool: ...
def validate(self, value: bool) -> None: ...
def has_changed(
self, initial: Optional[Union[bool, str]], data: Optional[str]
self,
initial: Optional[Union[bool, str]],
data: Optional[Union[bool, str]],
) -> bool: ...
class NullBooleanField(BooleanField):
@@ -403,8 +782,10 @@ class NullBooleanField(BooleanField):
required: bool
show_hidden_initial: bool
widget: Any = ...
def to_python(self, value: None) -> None: ...
def validate(self, value: None) -> None: ...
def to_python(
self, value: Optional[Union[bool, str]]
) -> Optional[bool]: ...
def validate(self, value: Optional[bool]) -> None: ...
class CallableChoiceIterator:
choices_func: Callable = ...
@@ -426,8 +807,72 @@ class ChoiceField(Field):
default_error_messages: Any = ...
choices: Any = ...
def __init__(self, *, choices: Any = ..., **kwargs: Any) -> None: ...
def __deepcopy__(self, memo: Dict[int, Any]) -> ChoiceField: ...
def to_python(self, value: Optional[Union[str, int]]) -> str: ...
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,
],
],
],
) -> ChoiceField: ...
def to_python(self, value: Optional[Union[int, str]]) -> str: ...
def validate(self, value: str) -> None: ...
def valid_value(self, value: str) -> bool: ...
@@ -440,12 +885,14 @@ class TypedChoiceField(ChoiceField):
localize: bool
required: bool
show_hidden_initial: bool
coerce: Union[Callable, Type[Union[str, float, int]]] = ...
coerce: Union[Callable, Type[Union[float, int, str]]] = ...
empty_value: Optional[str] = ...
def __init__(
self, *, coerce: Any = ..., empty_value: str = ..., **kwargs: Any
) -> None: ...
def clean(self, value: str) -> Optional[Union[str, int]]: ...
def clean(
self, value: Optional[str]
) -> Optional[Union[Decimal, float, int, str]]: ...
class MultipleChoiceField(ChoiceField):
disabled: bool
@@ -461,9 +908,15 @@ class MultipleChoiceField(ChoiceField):
hidden_widget: Any = ...
widget: django.forms.widgets.SelectMultiple = ...
default_error_messages: Any = ...
def to_python(self, value: Any): ...
def validate(self, value: Any) -> None: ...
def has_changed(self, initial: Any, data: Any): ...
def to_python(
self, value: Optional[Union[List[Union[int, str]], Tuple, str]]
) -> List[str]: ...
def validate(self, value: List[str]) -> None: ...
def has_changed(
self,
initial: Optional[Union[List[int], List[str], str]],
data: Optional[Union[List[str], str]],
) -> bool: ...
class TypedMultipleChoiceField(MultipleChoiceField):
disabled: bool
@@ -474,11 +927,13 @@ class TypedMultipleChoiceField(MultipleChoiceField):
localize: bool
required: bool
show_hidden_initial: bool
coerce: Union[Callable, Type[Union[int, float]]] = ...
coerce: Union[Callable, Type[Union[float, int]]] = ...
empty_value: Optional[List[Any]] = ...
def __init__(self, *, coerce: Any = ..., **kwargs: Any) -> None: ...
def clean(self, value: Any): ...
def validate(self, value: Any) -> None: ...
def clean(
self, value: List[str]
) -> Optional[Union[List[Decimal], List[float], List[int]]]: ...
def validate(self, value: List[str]) -> None: ...
class ComboField(Field):
disabled: bool
@@ -507,7 +962,7 @@ class MultiValueField(Field):
fields: Any = ...
def __init__(
self,
fields: Tuple[DateField, TimeField],
fields: Tuple[Field, Field],
*,
require_all_fields: bool = ...,
**kwargs: Any
@@ -517,19 +972,51 @@ class MultiValueField(Field):
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,
]
],
List[
Union[AdminTextInputWidget, AdminTextareaWidget, CharField]
],
OrderedDict,
Field,
Widget,
List[Union[Widget, Field]],
List[Union[Widget, CharField]],
],
],
) -> SplitDateTimeField: ...
def validate(self, value: Any) -> None: ...
def clean(self, value: Any): ...
) -> MultiValueField: ...
def validate(self, value: Union[datetime, str]) -> None: ...
def clean(
self,
value: Optional[
Union[
List[None],
List[Union[List[str], str]],
List[Union[date, time]],
datetime,
str,
]
],
) -> Optional[Union[datetime, str]]: ...
def compress(self, data_list: Any) -> None: ...
def has_changed(
self, initial: Optional[Union[List[None], datetime]], data: List[str]
self,
initial: Optional[Union[List[None], List[str], datetime, str]],
data: Union[List[None], List[Union[List[str], str]]],
) -> bool: ...
class FilePathField(ChoiceField):
@@ -550,7 +1037,7 @@ class FilePathField(ChoiceField):
match_re: Any = ...
def __init__(
self,
path: Any,
path: str,
*,
match: Optional[Any] = ...,
recursive: bool = ...,
@@ -579,7 +1066,12 @@ class SplitDateTimeField(MultiValueField):
input_time_formats: Optional[Any] = ...,
**kwargs: Any
) -> None: ...
def compress(self, data_list: Any): ...
def compress(
self,
data_list: Union[
List[Optional[date]], List[Optional[time]], List[Union[date, time]]
],
) -> Optional[datetime]: ...
class GenericIPAddressField(CharField):
disabled: bool
@@ -602,7 +1094,7 @@ class GenericIPAddressField(CharField):
def __init__(
self, *, protocol: str = ..., unpack_ipv4: bool = ..., **kwargs: Any
) -> None: ...
def to_python(self, value: Any): ...
def to_python(self, value: Optional[str]) -> str: ...
class SlugField(CharField):
disabled: bool
@@ -635,5 +1127,5 @@ class UUIDField(CharField):
show_hidden_initial: bool
strip: bool
default_error_messages: Any = ...
def prepare_value(self, value: Any): ...
def to_python(self, value: Any): ...
def prepare_value(self, value: UUID) -> str: ...
def to_python(self, value: str) -> Optional[UUID]: ...
+90 -32
View File
@@ -1,12 +1,32 @@
from typing import Any, Optional
from collections import OrderedDict
from datetime import date, datetime, time
from decimal import Decimal
from typing import Any, Dict, Iterator, List, Optional, Tuple, Type, Union
from django.forms.widgets import MediaDefiningClass
from django.core.exceptions import ValidationError
from django.core.files.uploadedfile import SimpleUploadedFile
from django.db.models.base import Model
from django.db.models.fields.files import FieldFile
from django.db.models.query import QuerySet
from django.forms.boundfield import BoundField
from django.forms.fields import Field
from django.forms.models import ModelForm
from django.forms.utils import ErrorDict, ErrorList
from django.forms.widgets import Media, MediaDefiningClass
from django.utils.safestring import SafeText
class DeclarativeFieldsMetaclass(MediaDefiningClass):
def __new__(mcs: Any, name: Any, bases: Any, attrs: Any): ...
def __new__(
mcs: Type[DeclarativeFieldsMetaclass],
name: str,
bases: Tuple[Type[BaseForm]],
attrs: OrderedDict,
) -> Type[Union[Form, ModelForm]]: ...
@classmethod
def __prepare__(metacls: Any, name: Any, bases: Any, **kwds: Any): ...
def __prepare__(
metacls: Any, name: str, bases: Tuple[Type[BaseForm]], **kwds: Any
) -> OrderedDict: ...
class BaseForm:
default_renderer: Any = ...
@@ -25,42 +45,80 @@ class BaseForm:
renderer: Any = ...
def __init__(
self,
data: Optional[Any] = ...,
files: Optional[Any] = ...,
auto_id: str = ...,
prefix: Optional[Any] = ...,
initial: Optional[Any] = ...,
error_class: Any = ...,
label_suffix: Optional[Any] = ...,
data: Optional[
Union[
Dict[str, Optional[Union[List[int], datetime, int, str]]],
Dict[str, Union[List[str], str]],
Dict[str, Union[datetime, Decimal, int, str]],
]
] = ...,
files: Optional[Dict[str, SimpleUploadedFile]] = ...,
auto_id: Optional[Union[bool, str]] = ...,
prefix: Optional[str] = ...,
initial: Optional[
Union[
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]],
]
] = ...,
error_class: Type[ErrorList] = ...,
label_suffix: None = ...,
empty_permitted: bool = ...,
field_order: Optional[Any] = ...,
use_required_attribute: Optional[Any] = ...,
renderer: Optional[Any] = ...,
field_order: None = ...,
use_required_attribute: Optional[bool] = ...,
renderer: Any = ...,
) -> None: ...
def order_fields(self, field_order: Any): ...
def __iter__(self) -> None: ...
def __getitem__(self, name: Any): ...
def order_fields(self, field_order: Optional[List[str]]) -> None: ...
def __iter__(self) -> Iterator[BoundField]: ...
def __getitem__(self, name: str) -> BoundField: ...
@property
def errors(self): ...
def is_valid(self): ...
def add_prefix(self, field_name: Any): ...
def add_initial_prefix(self, field_name: Any): ...
def as_table(self): ...
def as_ul(self): ...
def as_p(self): ...
def non_field_errors(self): ...
def add_error(self, field: Any, error: Any) -> None: ...
def errors(self) -> ErrorDict: ...
def is_valid(self) -> bool: ...
def add_prefix(self, field_name: str) -> str: ...
def add_initial_prefix(self, field_name: str) -> str: ...
def as_table(self) -> SafeText: ...
def as_ul(self) -> SafeText: ...
def as_p(self) -> SafeText: ...
def non_field_errors(self) -> ErrorList: ...
def add_error(
self, field: Optional[str], error: Union[ValidationError, str]
) -> None: ...
def has_error(self, field: Any, code: Optional[Any] = ...): ...
cleaned_data: Any = ...
def full_clean(self): ...
def clean(self): ...
def has_changed(self): ...
def changed_data(self): ...
def full_clean(self) -> None: ...
def clean(
self
) -> Union[
Dict[str, Optional[Union[int, str]]],
Dict[str, Union[date, time, Decimal, float, int]],
Dict[str, Union[date, str]],
Dict[str, SimpleUploadedFile],
Dict[str, QuerySet],
]: ...
def has_changed(self) -> bool: ...
def changed_data(self) -> List[str]: ...
@property
def media(self): ...
def media(self) -> Media: ...
def is_multipart(self): ...
def hidden_fields(self): ...
def visible_fields(self): ...
def get_initial_for_field(self, field: Any, field_name: Any): ...
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,
]
]: ...
class Form(BaseForm): ...
+2 -4
View File
@@ -4,11 +4,9 @@ from django.forms import Form
class ManagementForm(Form):
auto_id: Union[str, bool]
auto_id: Union[bool, str]
cleaned_data: Dict[str, Optional[int]]
data: Union[
Dict[str, Union[int, str, List[int]]], django.http.request.QueryDict
]
data: Dict[str, Union[List[int], int, str]]
empty_permitted: bool
error_class: Type[django.forms.utils.ErrorList]
fields: collections.OrderedDict
+339 -126
View File
@@ -1,87 +1,97 @@
from collections import OrderedDict
from datetime import date
from functools import partial
from datetime import date, datetime
from decimal import Decimal
from typing import (Any, Callable, Dict, Iterator, List, Optional, Tuple, Type,
Union)
from unittest.mock import MagicMock
from uuid import UUID
from django.contrib.admin.widgets import AdminTextInputWidget
from django.contrib.auth.forms import UsernameField
from django.contrib.auth.models import Permission
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.flatpages.forms import FlatpageForm
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.db.models.manager import Manager
from django.db.models.query import QuerySet
from django.forms.fields import CharField, ChoiceField, Field, URLField
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.forms import BaseForm, DeclarativeFieldsMetaclass
from django.forms.formsets import BaseFormSet
from django.forms.utils import ErrorList
from django.forms.widgets import Textarea, TextInput, Widget
from django.http.request import QueryDict
from django.utils.datastructures import MultiValueDict
from django.forms.widgets import (CheckboxInput, DateTimeInput, NumberInput,
RadioSelect, Select, SelectMultiple,
Textarea, TextInput, Widget)
ALL_FIELDS: str
def model_to_dict(
instance: Model,
fields: Optional[Union[List[Union[str, Callable]], Tuple[str]]] = ...,
exclude: Optional[List[Union[str, Callable]]] = ...,
) -> Dict[str, Optional[Union[int, date, str, List[Any]]]]: ...
fields: Optional[Union[List[Union[Callable, str]], Tuple[str]]] = ...,
exclude: Optional[Union[List[Union[Callable, str]], Tuple[str]]] = ...,
) -> Union[
Dict[str, Optional[Union[List[Model], date, int, str]]],
Dict[str, Optional[FieldFile]],
Dict[str, Union[FieldFile, int, str]],
Dict[str, float],
]: ...
def fields_for_model(
model: Type[Model],
fields: Optional[Union[List[Union[str, Callable]], Tuple]] = ...,
exclude: Optional[List[Union[str, Callable]]] = ...,
widgets: Optional[Dict[str, Union[Type[Textarea], TextInput]]] = ...,
formfield_callback: Optional[partial] = ...,
localized_fields: None = ...,
fields: Optional[Union[List[Union[Callable, str]], Tuple]] = ...,
exclude: Optional[Union[List[Union[Callable, str]], Tuple]] = ...,
widgets: Optional[Dict[str, Union[Type[Widget], Widget]]] = ...,
formfield_callback: Optional[Union[Callable, str]] = ...,
localized_fields: Optional[Union[Tuple[str], str]] = ...,
labels: Optional[Dict[str, str]] = ...,
help_texts: Optional[Dict[str, str]] = ...,
error_messages: Optional[Dict[str, Dict[str, str]]] = ...,
field_classes: Optional[
Dict[str, Type[Union[URLField, UsernameField]]]
] = ...,
field_classes: Optional[Dict[str, Type[CharField]]] = ...,
*,
apply_limit_choices_to: bool = ...
) -> OrderedDict: ...
class ModelFormOptions:
model: Optional[Type[django.db.models.base.Model]] = ...
fields: Optional[Union[List[Union[str, Callable]], Tuple, str]] = ...
exclude: Optional[Union[List[Union[str, Callable]], Tuple, str]] = ...
fields: Optional[Union[List[Union[Callable, str]], Tuple, str]] = ...
exclude: Optional[Union[List[Union[Callable, str]], Tuple, str]] = ...
widgets: Optional[
Union[
Dict[
str,
Type[
Union[
django.forms.widgets.TextInput,
django.forms.widgets.HiddenInput,
]
],
],
Dict[
str,
Union[
Type[django.forms.widgets.Textarea],
django.forms.widgets.Widget,
],
Dict[
str,
Union[
Type[django.forms.widgets.Widget], django.forms.widgets.Widget
],
]
] = ...
localized_fields: Optional[Union[str, Tuple[str]]] = ...
localized_fields: Optional[Union[Tuple[str], str]] = ...
labels: Optional[Dict[str, str]] = ...
help_texts: Optional[Dict[str, str]] = ...
error_messages: Optional[Dict[str, Dict[str, str]]] = ...
field_classes: Optional[
Dict[
str,
Dict[str, Type[django.forms.fields.CharField]]
] = ...
def __init__(
self,
options: Optional[
Type[
Union[
django.forms.fields.URLField,
django.contrib.auth.forms.UsernameField,
django.forms.fields.SlugField,
Any,
UserChangeForm.Meta,
UserCreationForm.Meta,
FlatpageForm.Meta,
]
],
]
] = ...
def __init__(self, options: Type[Any] = ...) -> None: ...
]
] = ...,
) -> None: ...
class ModelFormMetaclass(DeclarativeFieldsMetaclass):
def __new__(
@@ -95,19 +105,40 @@ class BaseModelForm(BaseForm):
instance: Any = ...
def __init__(
self,
data: Optional[Union[Dict[str, str], QueryDict]] = ...,
files: Optional[MultiValueDict] = ...,
auto_id: str = ...,
data: Optional[
Union[
Dict[str, Optional[Union[List[int], datetime, int, str]]],
Dict[str, Union[List[str], str]],
Dict[str, Union[datetime, Decimal, int, str]],
]
] = ...,
files: Optional[Dict[str, SimpleUploadedFile]] = ...,
auto_id: Union[bool, str] = ...,
prefix: None = ...,
initial: Optional[Dict[Any, Any]] = ...,
initial: Optional[
Union[
Dict[str, List[int]],
Dict[str, Union[List[Model], Model, QuerySet]],
Dict[str, Union[List[str], str]],
Dict[str, int],
]
] = ...,
error_class: Type[ErrorList] = ...,
label_suffix: None = ...,
empty_permitted: bool = ...,
instance: Optional[Model] = ...,
use_required_attribute: None = ...,
renderer: None = ...,
renderer: Any = ...,
) -> None: ...
def clean(self) -> Dict[str, Union[int, date]]: ...
def clean(
self
) -> Union[
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[File, str]],
]: ...
def validate_unique(self) -> None: ...
save_m2m: Any = ...
def save(self, commit: bool = ...) -> Model: ...
@@ -115,18 +146,18 @@ class BaseModelForm(BaseForm):
class ModelForm(BaseModelForm): ...
def modelform_factory(
model: Any,
form: Any = ...,
fields: Optional[Any] = ...,
exclude: Optional[Any] = ...,
formfield_callback: Optional[Any] = ...,
widgets: Optional[Any] = ...,
localized_fields: Optional[Any] = ...,
labels: Optional[Any] = ...,
help_texts: Optional[Any] = ...,
error_messages: Optional[Any] = ...,
field_classes: Optional[Any] = ...,
): ...
model: Type[Model],
form: Type[ModelForm] = ...,
fields: Optional[Union[List[str], str]] = ...,
exclude: None = ...,
formfield_callback: Optional[str] = ...,
widgets: None = ...,
localized_fields: None = ...,
labels: None = ...,
help_texts: None = ...,
error_messages: None = ...,
field_classes: None = ...,
) -> Any: ...
class BaseModelFormSet(BaseFormSet):
model: Any = ...
@@ -165,26 +196,26 @@ class BaseModelFormSet(BaseFormSet):
def add_fields(self, form: Any, index: Any): ...
def modelformset_factory(
model: Any,
form: Any = ...,
formfield_callback: Optional[Any] = ...,
formset: Any = ...,
model: Type[Model],
form: Type[ModelForm] = ...,
formfield_callback: None = ...,
formset: Type[BaseModelFormSet] = ...,
extra: int = ...,
can_delete: bool = ...,
can_order: bool = ...,
max_num: Optional[Any] = ...,
fields: Optional[Any] = ...,
exclude: Optional[Any] = ...,
widgets: Optional[Any] = ...,
max_num: None = ...,
fields: None = ...,
exclude: None = ...,
widgets: None = ...,
validate_max: bool = ...,
localized_fields: Optional[Any] = ...,
labels: Optional[Any] = ...,
help_texts: Optional[Any] = ...,
error_messages: Optional[Any] = ...,
min_num: Optional[Any] = ...,
localized_fields: None = ...,
labels: None = ...,
help_texts: None = ...,
error_messages: None = ...,
min_num: None = ...,
validate_min: bool = ...,
field_classes: Optional[Any] = ...,
): ...
field_classes: None = ...,
) -> Any: ...
class BaseInlineFormSet(BaseModelFormSet):
instance: Any = ...
@@ -208,33 +239,33 @@ class BaseInlineFormSet(BaseModelFormSet):
def get_unique_error_message(self, unique_check: Any): ...
def inlineformset_factory(
parent_model: Any,
model: Any,
form: Any = ...,
formset: Any = ...,
fk_name: Optional[Any] = ...,
fields: Optional[Any] = ...,
exclude: Optional[Any] = ...,
parent_model: Type[Model],
model: Type[Model],
form: Type[ModelForm] = ...,
formset: Type[BaseInlineFormSet] = ...,
fk_name: Optional[str] = ...,
fields: Optional[str] = ...,
exclude: None = ...,
extra: int = ...,
can_order: bool = ...,
can_delete: bool = ...,
max_num: Optional[Any] = ...,
formfield_callback: Optional[Any] = ...,
widgets: Optional[Any] = ...,
max_num: None = ...,
formfield_callback: None = ...,
widgets: None = ...,
validate_max: bool = ...,
localized_fields: Optional[Any] = ...,
labels: Optional[Any] = ...,
help_texts: Optional[Any] = ...,
error_messages: Optional[Any] = ...,
min_num: Optional[Any] = ...,
localized_fields: None = ...,
labels: None = ...,
help_texts: None = ...,
error_messages: None = ...,
min_num: None = ...,
validate_min: bool = ...,
field_classes: Optional[Any] = ...,
): ...
field_classes: None = ...,
) -> Any: ...
class InlineForeignKeyField(Field):
disabled: bool
help_text: str
initial: Optional[Union[str, django.db.models.base.Model, int]]
initial: Optional[Union[django.db.models.base.Model, int, str]]
label: Optional[str]
label_suffix: None
localize: bool
@@ -253,23 +284,27 @@ class InlineForeignKeyField(Field):
to_field: Optional[Any] = ...,
**kwargs: Any
) -> None: ...
def clean(self, value: Optional[str]) -> Model: ...
def has_changed(self, initial: int, data: str) -> bool: ...
def clean(self, value: Optional[Union[int, str]]) -> Optional[Model]: ...
def has_changed(
self,
initial: Optional[Union[int, str]],
data: Optional[Union[int, str]],
) -> bool: ...
class ModelChoiceIterator:
field: django.forms.models.ModelChoiceField = ...
queryset: Optional[django.db.models.query.QuerySet] = ...
def __init__(self, field: Any) -> None: ...
def __init__(self, field: ModelChoiceField) -> None: ...
def __iter__(self) -> Iterator[Tuple[str, str]]: ...
def __len__(self): ...
def __bool__(self): ...
def __len__(self) -> int: ...
def __bool__(self) -> bool: ...
def choice(self, obj: Model) -> Tuple[int, str]: ...
class ModelChoiceField(ChoiceField):
disabled: bool
error_messages: Dict[str, str]
help_text: str
initial: Optional[Union[Callable, uuid.UUID, int, str]]
initial: Optional[Union[Callable, int, str, uuid.UUID]]
label: Optional[str]
label_suffix: None
localize: bool
@@ -285,7 +320,7 @@ class ModelChoiceField(ChoiceField):
to_field_name: None = ...
def __init__(
self,
queryset: Any,
queryset: Optional[Union[Manager, QuerySet]],
*,
empty_label: str = ...,
required: bool = ...,
@@ -297,28 +332,113 @@ class ModelChoiceField(ChoiceField):
limit_choices_to: Optional[Any] = ...,
**kwargs: Any
) -> None: ...
def get_limit_choices_to(self) -> Dict[Any, Any]: ...
def get_limit_choices_to(
self
) -> Optional[
Union[Dict[str, Union[int, str]], Dict[str, datetime], Q, MagicMock]
]: ...
def __deepcopy__(
self,
memo: Dict[
int,
Union[
OrderedDict,
Widget,
List[Union[Widget, Field]],
Field,
List[Union[AdminTextInputWidget, CharField]],
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,
],
],
],
) -> ModelChoiceField: ...
def label_from_instance(self, obj: Model) -> str: ...
choices: Any = ...
def prepare_value(
self, value: Optional[Union[int, str, Model]]
) -> Optional[Union[str, int]]: ...
def to_python(self, value: str) -> Optional[Model]: ...
def validate(self, value: Model) -> None: ...
def has_changed(self, initial: None, data: str) -> bool: ...
self,
value: Optional[
Union[Dict[str, str], List[str], Model, int, str, UUID]
],
) -> Optional[Union[Dict[str, str], List[str], int, str, UUID]]: ...
def to_python(
self,
value: Optional[Union[List[Dict[str, str]], List[List[str]], int, str]],
) -> Optional[Model]: ...
def validate(self, value: Optional[Model]) -> None: ...
def has_changed(
self,
initial: Optional[Union[Model, int, str, UUID]],
data: Optional[Union[int, str]],
) -> bool: ...
class ModelMultipleChoiceField(ModelChoiceField):
disabled: bool
@@ -333,10 +453,103 @@ class ModelMultipleChoiceField(ModelChoiceField):
widget: Any = ...
hidden_widget: Any = ...
default_error_messages: Any = ...
def __init__(self, queryset: Any, **kwargs: Any) -> None: ...
def to_python(self, value: Any): ...
def clean(self, value: List[str]) -> QuerySet: ...
def __init__(self, queryset: QuerySet, **kwargs: Any) -> None: ...
def to_python(
self,
value: Union[
List[str],
Tuple[
int,
int,
int,
int,
int,
int,
int,
int,
int,
int,
int,
int,
int,
int,
int,
int,
int,
int,
int,
int,
int,
int,
int,
int,
int,
int,
int,
int,
int,
int,
int,
int,
int,
int,
int,
int,
int,
int,
int,
int,
int,
int,
int,
int,
int,
int,
int,
int,
int,
int,
],
],
) -> List[Model]: ...
def clean(
self,
value: Optional[
Union[
List[Dict[str, str]],
List[List[str]],
List[Union[int, str]],
List[Model],
Tuple,
str,
]
],
) -> QuerySet: ...
def prepare_value(
self, value: Union[Permission, List[str]]
) -> Union[List[str], int]: ...
def has_changed(self, initial: List[Any], data: List[str]) -> bool: ...
self,
value: Optional[
Union[
List[Dict[str, str]],
List[List[str]],
List[Union[int, str]],
List[Model],
Tuple,
Model,
QuerySet,
str,
]
],
) -> Optional[
Union[
List[Dict[str, str]],
List[List[str]],
List[Union[int, str]],
int,
str,
]
]: ...
def has_changed(
self,
initial: Optional[Union[List[Model], QuerySet, str]],
data: Optional[Union[List[int], List[str], str]],
) -> bool: ...
File diff suppressed because it is too large Load Diff
+7 -7
View File
@@ -7,7 +7,9 @@ from django.utils.safestring import SafeText
def pretty_name(name: str) -> str: ...
def flatatt(attrs: Dict[str, Optional[Union[bool, str]]]) -> SafeText: ...
def flatatt(
attrs: Union[Dict[str, None], Dict[str, Union[bool, str]]]
) -> SafeText: ...
class ErrorDict(dict):
def as_data(self) -> Dict[str, List[ValidationError]]: ...
@@ -19,13 +21,11 @@ class ErrorDict(dict):
def as_text(self) -> str: ...
class ErrorList(UserList, list):
data: List[Union[str, django.core.exceptions.ValidationError]]
data: List[Union[django.core.exceptions.ValidationError, str]]
error_class: str = ...
def __init__(
self,
initlist: Optional[
Union[List[ValidationError], List[str], ErrorList]
] = ...,
initlist: Optional[Union[List[ValidationError], List[str]]] = ...,
error_class: Optional[str] = ...,
) -> None: ...
def as_data(self) -> List[ValidationError]: ...
@@ -36,8 +36,8 @@ class ErrorList(UserList, list):
def as_ul(self) -> str: ...
def as_text(self) -> str: ...
def __contains__(self, item: str) -> bool: ...
def __eq__(self, other: Union[List[str], ErrorList]) -> bool: ...
def __getitem__(self, i: Union[str, int]) -> str: ...
def __eq__(self, other: List[str]) -> bool: ...
def __getitem__(self, i: Union[int, str]) -> str: ...
def __reduce_ex__(
self, *args: Any, **kwargs: Any
) -> Tuple[
File diff suppressed because it is too large Load Diff