mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-09 05:24:53 +08:00
run black over stubs, add checking to travis
This commit is contained in:
@@ -7,7 +7,6 @@ from django.forms.utils import ErrorList
|
||||
from django.forms.widgets import Widget
|
||||
from django.utils.safestring import SafeText
|
||||
|
||||
|
||||
class BoundField:
|
||||
initial: Any
|
||||
form: django.forms.forms.BaseForm = ...
|
||||
@@ -23,17 +22,10 @@ class BoundField:
|
||||
def __bool__(self) -> bool: ...
|
||||
def __iter__(self): ...
|
||||
def __len__(self) -> int: ...
|
||||
def __getitem__(
|
||||
self, idx: Union[int, slice, str]
|
||||
) -> Union[List[BoundWidget], BoundWidget]: ...
|
||||
def __getitem__(self, idx: Union[int, slice, str]) -> Union[List[BoundWidget], BoundWidget]: ...
|
||||
@property
|
||||
def errors(self) -> ErrorList: ...
|
||||
def as_widget(
|
||||
self,
|
||||
widget: Optional[Widget] = ...,
|
||||
attrs: None = ...,
|
||||
only_initial: bool = ...,
|
||||
) -> SafeText: ...
|
||||
def as_widget(self, widget: Optional[Widget] = ..., attrs: None = ..., only_initial: bool = ...) -> SafeText: ...
|
||||
def as_text(self, attrs: None = ..., **kwargs: Any) -> SafeText: ...
|
||||
def as_textarea(self, attrs: None = ..., **kwargs: Any) -> SafeText: ...
|
||||
def as_hidden(self, attrs: None = ..., **kwargs: Any) -> SafeText: ...
|
||||
@@ -41,10 +33,7 @@ class BoundField:
|
||||
def data(self) -> Any: ...
|
||||
def value(self) -> Any: ...
|
||||
def label_tag(
|
||||
self,
|
||||
contents: Optional[str] = ...,
|
||||
attrs: Optional[Dict[str, str]] = ...,
|
||||
label_suffix: Optional[str] = ...,
|
||||
self, contents: Optional[str] = ..., attrs: Optional[Dict[str, str]] = ..., label_suffix: Optional[str] = ...
|
||||
) -> SafeText: ...
|
||||
def css_classes(self, extra_classes: None = ...) -> str: ...
|
||||
@property
|
||||
@@ -54,15 +43,11 @@ class BoundField:
|
||||
@property
|
||||
def id_for_label(self) -> str: ...
|
||||
def initial(self) -> Any: ...
|
||||
def build_widget_attrs(
|
||||
self, attrs: Dict[str, str], widget: Optional[Widget] = ...
|
||||
) -> Dict[str, Union[bool, str]]: ...
|
||||
def build_widget_attrs(self, attrs: Dict[str, str], widget: Optional[Widget] = ...) -> Dict[str, Union[bool, str]]: ...
|
||||
|
||||
class BoundWidget:
|
||||
parent_widget: django.forms.widgets.Widget = ...
|
||||
data: Dict[
|
||||
str, Optional[Union[Dict[str, Union[bool, str]], int, str]]
|
||||
] = ...
|
||||
data: Dict[str, Optional[Union[Dict[str, Union[bool, str]], int, str]]] = ...
|
||||
renderer: django.forms.renderers.DjangoTemplates = ...
|
||||
def __init__(
|
||||
self,
|
||||
|
||||
@@ -11,7 +11,6 @@ from django.forms.boundfield import BoundField
|
||||
from django.forms.forms import BaseForm
|
||||
from django.forms.widgets import Input, Widget
|
||||
|
||||
|
||||
class Field:
|
||||
initial: None
|
||||
label: None
|
||||
@@ -45,34 +44,17 @@ class Field:
|
||||
) -> None: ...
|
||||
def prepare_value(self, value: Any) -> Any: ...
|
||||
def to_python(
|
||||
self,
|
||||
value: Optional[Union[List[None], List[str], datetime, float, str]],
|
||||
self, value: Optional[Union[List[None], List[str], datetime, float, str]]
|
||||
) -> Optional[Union[List[None], List[str], datetime, float, str]]: ...
|
||||
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[datetime, Decimal, float, str]],
|
||||
data: Optional[str],
|
||||
) -> bool: ...
|
||||
def get_bound_field(
|
||||
self, form: BaseForm, field_name: str
|
||||
) -> BoundField: ...
|
||||
def has_changed(self, initial: Optional[Union[datetime, Decimal, float, str]], data: Optional[str]) -> bool: ...
|
||||
def get_bound_field(self, form: BaseForm, field_name: str) -> BoundField: ...
|
||||
def __deepcopy__(
|
||||
self,
|
||||
memo: Dict[
|
||||
int,
|
||||
Union[
|
||||
List[Tuple[Union[int, str], str]],
|
||||
List[Widget],
|
||||
OrderedDict,
|
||||
Field,
|
||||
Widget,
|
||||
],
|
||||
],
|
||||
self, memo: Dict[int, Union[List[Tuple[Union[int, str], str]], List[Widget], OrderedDict, Field, Widget]]
|
||||
) -> Field: ...
|
||||
|
||||
class CharField(Field):
|
||||
@@ -85,12 +67,7 @@ class CharField(Field):
|
||||
localize: bool
|
||||
required: bool
|
||||
show_hidden_initial: bool
|
||||
validators: List[
|
||||
Union[
|
||||
django.core.validators.BaseValidator,
|
||||
django.core.validators.ProhibitNullCharactersValidator,
|
||||
]
|
||||
]
|
||||
validators: List[Union[django.core.validators.BaseValidator, django.core.validators.ProhibitNullCharactersValidator]]
|
||||
widget: django.forms.widgets.TextInput
|
||||
max_length: Optional[Union[int, str]] = ...
|
||||
min_length: Optional[Union[int, str]] = ...
|
||||
@@ -105,9 +82,7 @@ class CharField(Field):
|
||||
empty_value: str = ...,
|
||||
**kwargs: Any
|
||||
) -> None: ...
|
||||
def to_python(
|
||||
self, value: Optional[Union[List[int], Tuple, int, str]]
|
||||
) -> Optional[str]: ...
|
||||
def to_python(self, value: Optional[Union[List[int], Tuple, int, str]]) -> Optional[str]: ...
|
||||
def widget_attrs(self, widget: Widget) -> Dict[str, str]: ...
|
||||
|
||||
class IntegerField(Field):
|
||||
@@ -126,19 +101,9 @@ class IntegerField(Field):
|
||||
widget: django.forms.widgets.NumberInput = ...
|
||||
default_error_messages: Any = ...
|
||||
re_decimal: Any = ...
|
||||
def __init__(
|
||||
self,
|
||||
*,
|
||||
max_value: Optional[Any] = ...,
|
||||
min_value: Optional[Any] = ...,
|
||||
**kwargs: Any
|
||||
) -> None: ...
|
||||
def to_python(
|
||||
self, value: Optional[Union[float, str]]
|
||||
) -> Optional[int]: ...
|
||||
def widget_attrs(
|
||||
self, widget: Widget
|
||||
) -> Dict[str, Union[Decimal, float]]: ...
|
||||
def __init__(self, *, max_value: Optional[Any] = ..., min_value: Optional[Any] = ..., **kwargs: Any) -> None: ...
|
||||
def to_python(self, value: Optional[Union[float, str]]) -> Optional[int]: ...
|
||||
def widget_attrs(self, widget: Widget) -> Dict[str, Union[Decimal, float]]: ...
|
||||
|
||||
class FloatField(IntegerField):
|
||||
disabled: bool
|
||||
@@ -155,9 +120,7 @@ class FloatField(IntegerField):
|
||||
validators: List[django.core.validators.BaseValidator]
|
||||
widget: django.forms.widgets.NumberInput
|
||||
default_error_messages: Any = ...
|
||||
def to_python(
|
||||
self, value: Optional[Union[float, str]]
|
||||
) -> Optional[float]: ...
|
||||
def to_python(self, value: Optional[Union[float, str]]) -> Optional[float]: ...
|
||||
def validate(self, value: Optional[float]) -> None: ...
|
||||
def widget_attrs(self, widget: Input) -> Dict[str, Union[float, str]]: ...
|
||||
|
||||
@@ -175,12 +138,7 @@ class DecimalField(IntegerField):
|
||||
min_value: Optional[Union[decimal.Decimal, int]]
|
||||
required: bool
|
||||
show_hidden_initial: bool
|
||||
validators: List[
|
||||
Union[
|
||||
django.core.validators.BaseValidator,
|
||||
django.core.validators.DecimalValidator,
|
||||
]
|
||||
]
|
||||
validators: List[Union[django.core.validators.BaseValidator, django.core.validators.DecimalValidator]]
|
||||
widget: django.forms.widgets.NumberInput
|
||||
default_error_messages: Any = ...
|
||||
def __init__(
|
||||
@@ -192,19 +150,13 @@ class DecimalField(IntegerField):
|
||||
decimal_places: Optional[Any] = ...,
|
||||
**kwargs: Any
|
||||
) -> None: ...
|
||||
def to_python(
|
||||
self, value: Optional[Union[Decimal, float, str]]
|
||||
) -> Optional[Decimal]: ...
|
||||
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
|
||||
) -> Dict[str, Union[Decimal, int, str]]: ...
|
||||
def widget_attrs(self, widget: Widget) -> Dict[str, Union[Decimal, int, str]]: ...
|
||||
|
||||
class BaseTemporalField(Field):
|
||||
input_formats: Any = ...
|
||||
def __init__(
|
||||
self, *, input_formats: Optional[Any] = ..., **kwargs: Any
|
||||
) -> None: ...
|
||||
def __init__(self, *, input_formats: Optional[Any] = ..., **kwargs: Any) -> None: ...
|
||||
def to_python(self, value: str) -> datetime: ...
|
||||
def strptime(self, value: Any, format: Any) -> None: ...
|
||||
|
||||
@@ -222,9 +174,7 @@ class DateField(BaseTemporalField):
|
||||
widget: django.forms.widgets.DateInput = ...
|
||||
input_formats: Any = ...
|
||||
default_error_messages: Any = ...
|
||||
def to_python(
|
||||
self, value: Optional[Union[date, str]]
|
||||
) -> Optional[date]: ...
|
||||
def to_python(self, value: Optional[Union[date, str]]) -> Optional[date]: ...
|
||||
def strptime(self, value: str, format: str) -> date: ...
|
||||
|
||||
class TimeField(BaseTemporalField):
|
||||
@@ -241,9 +191,7 @@ class TimeField(BaseTemporalField):
|
||||
widget: django.forms.widgets.TimeInput = ...
|
||||
input_formats: Any = ...
|
||||
default_error_messages: Any = ...
|
||||
def to_python(
|
||||
self, value: Optional[Union[time, str]]
|
||||
) -> Optional[time]: ...
|
||||
def to_python(self, value: Optional[Union[time, str]]) -> Optional[time]: ...
|
||||
def strptime(self, value: str, format: str) -> time: ...
|
||||
|
||||
class DateTimeField(BaseTemporalField):
|
||||
@@ -260,12 +208,8 @@ class DateTimeField(BaseTemporalField):
|
||||
widget: django.forms.widgets.DateTimeInput = ...
|
||||
input_formats: Any = ...
|
||||
default_error_messages: Any = ...
|
||||
def prepare_value(
|
||||
self, value: Optional[datetime]
|
||||
) -> Optional[datetime]: ...
|
||||
def to_python(
|
||||
self, value: Optional[Union[date, str]]
|
||||
) -> Optional[datetime]: ...
|
||||
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):
|
||||
@@ -278,9 +222,7 @@ class DurationField(Field):
|
||||
required: bool
|
||||
show_hidden_initial: bool
|
||||
default_error_messages: Any = ...
|
||||
def prepare_value(
|
||||
self, value: Optional[Union[timedelta, str]]
|
||||
) -> Optional[str]: ...
|
||||
def prepare_value(self, value: Optional[Union[timedelta, str]]) -> Optional[str]: ...
|
||||
def to_python(self, value: Union[int, str]) -> timedelta: ...
|
||||
|
||||
class RegexField(CharField):
|
||||
@@ -346,27 +288,11 @@ class FileField(Field):
|
||||
default_error_messages: Any = ...
|
||||
max_length: Optional[int] = ...
|
||||
allow_empty_file: bool = ...
|
||||
def __init__(
|
||||
self,
|
||||
*,
|
||||
max_length: Optional[Any] = ...,
|
||||
allow_empty_file: bool = ...,
|
||||
**kwargs: Any
|
||||
) -> None: ...
|
||||
def to_python(
|
||||
self, data: Optional[Union[SimpleUploadedFile, str]]
|
||||
) -> Optional[SimpleUploadedFile]: ...
|
||||
def clean(
|
||||
self, data: Any, initial: Optional[Union[FieldFile, str]] = ...
|
||||
) -> Optional[Union[bool, File, str]]: ...
|
||||
def bound_data(
|
||||
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: ...
|
||||
def __init__(self, *, max_length: Optional[Any] = ..., allow_empty_file: bool = ..., **kwargs: Any) -> None: ...
|
||||
def to_python(self, data: Optional[Union[SimpleUploadedFile, str]]) -> Optional[SimpleUploadedFile]: ...
|
||||
def clean(self, data: Any, initial: Optional[Union[FieldFile, str]] = ...) -> Optional[Union[bool, File, str]]: ...
|
||||
def bound_data(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
|
||||
@@ -381,9 +307,7 @@ class ImageField(FileField):
|
||||
show_hidden_initial: bool
|
||||
default_validators: Any = ...
|
||||
default_error_messages: Any = ...
|
||||
def to_python(
|
||||
self, data: Optional[SimpleUploadedFile]
|
||||
) -> Optional[SimpleUploadedFile]: ...
|
||||
def to_python(self, data: Optional[SimpleUploadedFile]) -> Optional[SimpleUploadedFile]: ...
|
||||
def widget_attrs(self, widget: Widget) -> Dict[str, str]: ...
|
||||
|
||||
class URLField(CharField):
|
||||
@@ -427,11 +351,7 @@ class BooleanField(Field):
|
||||
widget: django.forms.widgets.CheckboxInput = ...
|
||||
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[Union[bool, str]],
|
||||
) -> bool: ...
|
||||
def has_changed(self, initial: Optional[Union[bool, str]], data: Optional[Union[bool, str]]) -> bool: ...
|
||||
|
||||
class NullBooleanField(BooleanField):
|
||||
disabled: bool
|
||||
@@ -443,9 +363,7 @@ class NullBooleanField(BooleanField):
|
||||
required: bool
|
||||
show_hidden_initial: bool
|
||||
widget: Any = ...
|
||||
def to_python(
|
||||
self, value: Optional[Union[bool, str]]
|
||||
) -> Optional[bool]: ...
|
||||
def to_python(self, value: Optional[Union[bool, str]]) -> Optional[bool]: ...
|
||||
def validate(self, value: Optional[bool]) -> None: ...
|
||||
|
||||
class CallableChoiceIterator:
|
||||
@@ -469,17 +387,7 @@ class ChoiceField(Field):
|
||||
choices: Any = ...
|
||||
def __init__(self, *, choices: Any = ..., **kwargs: Any) -> None: ...
|
||||
def __deepcopy__(
|
||||
self,
|
||||
memo: Dict[
|
||||
int,
|
||||
Union[
|
||||
List[Tuple[Union[int, str], str]],
|
||||
List[Widget],
|
||||
OrderedDict,
|
||||
Field,
|
||||
Widget,
|
||||
],
|
||||
],
|
||||
self, memo: Dict[int, Union[List[Tuple[Union[int, str], str]], List[Widget], OrderedDict, Field, Widget]]
|
||||
) -> ChoiceField: ...
|
||||
def to_python(self, value: Optional[Union[int, str]]) -> str: ...
|
||||
def validate(self, value: str) -> None: ...
|
||||
@@ -496,12 +404,8 @@ class TypedChoiceField(ChoiceField):
|
||||
show_hidden_initial: bool
|
||||
coerce: Union[Callable, Type[Union[bool, float, str]]] = ...
|
||||
empty_value: Optional[str] = ...
|
||||
def __init__(
|
||||
self, *, coerce: Any = ..., empty_value: str = ..., **kwargs: Any
|
||||
) -> None: ...
|
||||
def clean(
|
||||
self, value: Optional[str]
|
||||
) -> Optional[Union[Decimal, float, str]]: ...
|
||||
def __init__(self, *, coerce: Any = ..., empty_value: str = ..., **kwargs: Any) -> None: ...
|
||||
def clean(self, value: Optional[str]) -> Optional[Union[Decimal, float, str]]: ...
|
||||
|
||||
class MultipleChoiceField(ChoiceField):
|
||||
disabled: bool
|
||||
@@ -517,15 +421,9 @@ class MultipleChoiceField(ChoiceField):
|
||||
hidden_widget: Any = ...
|
||||
widget: django.forms.widgets.SelectMultiple = ...
|
||||
default_error_messages: Any = ...
|
||||
def to_python(
|
||||
self, value: Optional[Union[List[Union[int, str]], Tuple, str]]
|
||||
) -> List[str]: ...
|
||||
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: ...
|
||||
def has_changed(self, initial: Optional[Union[List[int], List[str], str]], data: Optional[Union[List[str], str]]) -> bool: ...
|
||||
|
||||
class TypedMultipleChoiceField(MultipleChoiceField):
|
||||
disabled: bool
|
||||
@@ -539,9 +437,7 @@ class TypedMultipleChoiceField(MultipleChoiceField):
|
||||
coerce: Union[Callable, Type[float]] = ...
|
||||
empty_value: Optional[List[Any]] = ...
|
||||
def __init__(self, *, coerce: Any = ..., **kwargs: Any) -> None: ...
|
||||
def clean(
|
||||
self, value: List[str]
|
||||
) -> Optional[Union[List[bool], List[Decimal], List[float]]]: ...
|
||||
def clean(self, value: List[str]) -> Optional[Union[List[bool], List[Decimal], List[float]]]: ...
|
||||
def validate(self, value: List[str]) -> None: ...
|
||||
|
||||
class ComboField(Field):
|
||||
@@ -569,31 +465,15 @@ class MultiValueField(Field):
|
||||
default_error_messages: Any = ...
|
||||
require_all_fields: bool = ...
|
||||
fields: Any = ...
|
||||
def __init__(
|
||||
self,
|
||||
fields: Tuple[Field, Field],
|
||||
*,
|
||||
require_all_fields: bool = ...,
|
||||
**kwargs: Any
|
||||
) -> None: ...
|
||||
def __deepcopy__(
|
||||
self,
|
||||
memo: Dict[
|
||||
int, Union[List[Tuple[str, str]], OrderedDict, Field, Widget]
|
||||
],
|
||||
) -> MultiValueField: ...
|
||||
def __init__(self, fields: Tuple[Field, Field], *, require_all_fields: bool = ..., **kwargs: Any) -> None: ...
|
||||
def __deepcopy__(self, memo: Dict[int, Union[List[Tuple[str, str]], OrderedDict, Field, Widget]]) -> MultiValueField: ...
|
||||
def validate(self, value: Union[datetime, str]) -> None: ...
|
||||
def clean(
|
||||
self,
|
||||
value: Optional[
|
||||
Union[List[None], List[datetime], List[str], datetime, str]
|
||||
],
|
||||
self, value: Optional[Union[List[None], List[datetime], List[str], datetime, str]]
|
||||
) -> Optional[Union[datetime, str]]: ...
|
||||
def compress(self, data_list: Any) -> None: ...
|
||||
def has_changed(
|
||||
self,
|
||||
initial: Optional[Union[List[None], List[str], datetime, str]],
|
||||
data: Union[List[None], List[str]],
|
||||
self, initial: Optional[Union[List[None], List[str], datetime, str]], data: Union[List[None], List[str]]
|
||||
) -> bool: ...
|
||||
|
||||
class FilePathField(ChoiceField):
|
||||
@@ -637,15 +517,9 @@ class SplitDateTimeField(MultiValueField):
|
||||
hidden_widget: Any = ...
|
||||
default_error_messages: Any = ...
|
||||
def __init__(
|
||||
self,
|
||||
*,
|
||||
input_date_formats: Optional[Any] = ...,
|
||||
input_time_formats: Optional[Any] = ...,
|
||||
**kwargs: Any
|
||||
self, *, input_date_formats: Optional[Any] = ..., input_time_formats: Optional[Any] = ..., **kwargs: Any
|
||||
) -> None: ...
|
||||
def compress(
|
||||
self, data_list: List[Optional[datetime]]
|
||||
) -> Optional[datetime]: ...
|
||||
def compress(self, data_list: List[Optional[datetime]]) -> Optional[datetime]: ...
|
||||
|
||||
class GenericIPAddressField(CharField):
|
||||
disabled: bool
|
||||
@@ -665,9 +539,7 @@ class GenericIPAddressField(CharField):
|
||||
widget: django.forms.widgets.TextInput
|
||||
unpack_ipv4: bool = ...
|
||||
default_validators: List[Callable] = ...
|
||||
def __init__(
|
||||
self, *, protocol: str = ..., unpack_ipv4: bool = ..., **kwargs: Any
|
||||
) -> None: ...
|
||||
def __init__(self, *, protocol: str = ..., unpack_ipv4: bool = ..., **kwargs: Any) -> None: ...
|
||||
def to_python(self, value: Optional[str]) -> str: ...
|
||||
|
||||
class SlugField(CharField):
|
||||
|
||||
@@ -13,18 +13,12 @@ from django.http.request import QueryDict
|
||||
from django.utils.datastructures import MultiValueDict
|
||||
from django.utils.safestring import SafeText
|
||||
|
||||
|
||||
class DeclarativeFieldsMetaclass(MediaDefiningClass):
|
||||
def __new__(
|
||||
mcs: Type[DeclarativeFieldsMetaclass],
|
||||
name: str,
|
||||
bases: Tuple[Type[BaseForm]],
|
||||
attrs: OrderedDict,
|
||||
mcs: Type[DeclarativeFieldsMetaclass], name: str, bases: Tuple[Type[BaseForm]], attrs: OrderedDict
|
||||
) -> Type[BaseForm]: ...
|
||||
@classmethod
|
||||
def __prepare__(
|
||||
metacls: Any, name: str, bases: Tuple[Type[BaseForm]], **kwds: Any
|
||||
) -> OrderedDict: ...
|
||||
def __prepare__(metacls: Any, name: str, bases: Tuple[Type[BaseForm]], **kwds: Any) -> OrderedDict: ...
|
||||
|
||||
class BaseForm:
|
||||
default_renderer: Any = ...
|
||||
@@ -43,21 +37,11 @@ class BaseForm:
|
||||
renderer: Any = ...
|
||||
def __init__(
|
||||
self,
|
||||
data: Optional[
|
||||
Union[
|
||||
Dict[str, Union[List[int], int, str]],
|
||||
Dict[str, Union[List[str], str]],
|
||||
QueryDict,
|
||||
]
|
||||
] = ...,
|
||||
files: Optional[
|
||||
Union[Dict[str, SimpleUploadedFile], MultiValueDict]
|
||||
] = ...,
|
||||
data: Optional[Union[Dict[str, Union[List[int], int, str]], Dict[str, Union[List[str], str]], QueryDict]] = ...,
|
||||
files: Optional[Union[Dict[str, SimpleUploadedFile], MultiValueDict]] = ...,
|
||||
auto_id: Optional[Union[bool, str]] = ...,
|
||||
prefix: Optional[str] = ...,
|
||||
initial: Optional[
|
||||
Union[Dict[str, List[int]], Dict[str, date], Dict[str, str]]
|
||||
] = ...,
|
||||
initial: Optional[Union[Dict[str, List[int]], Dict[str, date], Dict[str, str]]] = ...,
|
||||
error_class: Type[ErrorList] = ...,
|
||||
label_suffix: None = ...,
|
||||
empty_permitted: bool = ...,
|
||||
@@ -77,17 +61,11 @@ class BaseForm:
|
||||
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 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) -> None: ...
|
||||
def clean(
|
||||
self
|
||||
) -> Dict[
|
||||
str, Optional[Union[datetime, SimpleUploadedFile, QuerySet, str]]
|
||||
]: ...
|
||||
def clean(self) -> Dict[str, Optional[Union[datetime, SimpleUploadedFile, QuerySet, str]]]: ...
|
||||
def has_changed(self) -> bool: ...
|
||||
def changed_data(self) -> List[str]: ...
|
||||
@property
|
||||
|
||||
@@ -5,7 +5,6 @@ from django.forms import Form
|
||||
from django.forms.renderers import BaseRenderer
|
||||
from django.forms.utils import ErrorList
|
||||
|
||||
|
||||
class ManagementForm(Form):
|
||||
auto_id: Union[bool, str]
|
||||
cleaned_data: Dict[str, Optional[int]]
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
from collections import OrderedDict
|
||||
from datetime import date, datetime
|
||||
from decimal import Decimal
|
||||
from typing import (Any, Callable, Dict, Iterator, List, Optional, Tuple, Type,
|
||||
Union)
|
||||
from typing import Any, Callable, Dict, Iterator, List, Optional, Tuple, Type, Union
|
||||
from unittest.mock import MagicMock
|
||||
from uuid import UUID
|
||||
|
||||
@@ -47,38 +46,19 @@ class ModelFormOptions:
|
||||
model: Optional[Type[django.db.models.base.Model]] = ...
|
||||
fields: Optional[Union[List[Union[Callable, str]], Tuple, str]] = ...
|
||||
exclude: Optional[Union[List[Union[Callable, str]], Tuple, str]] = ...
|
||||
widgets: Optional[
|
||||
Union[
|
||||
Dict[str, Type[django.forms.widgets.Input]],
|
||||
Dict[str, django.forms.widgets.Widget],
|
||||
]
|
||||
] = ...
|
||||
widgets: Optional[Union[Dict[str, Type[django.forms.widgets.Input]], Dict[str, django.forms.widgets.Widget]]] = ...
|
||||
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[django.forms.fields.CharField]]
|
||||
] = ...
|
||||
field_classes: Optional[Dict[str, Type[django.forms.fields.CharField]]] = ...
|
||||
def __init__(
|
||||
self,
|
||||
options: Optional[
|
||||
Type[
|
||||
Union[
|
||||
UserChangeForm.Meta,
|
||||
UserCreationForm.Meta,
|
||||
FlatpageForm.Meta,
|
||||
]
|
||||
]
|
||||
] = ...,
|
||||
self, options: Optional[Type[Union[UserChangeForm.Meta, UserCreationForm.Meta, FlatpageForm.Meta]]] = ...
|
||||
) -> None: ...
|
||||
|
||||
class ModelFormMetaclass(DeclarativeFieldsMetaclass):
|
||||
def __new__(
|
||||
mcs: Type[ModelFormMetaclass],
|
||||
name: str,
|
||||
bases: Tuple[Type[ModelForm]],
|
||||
attrs: OrderedDict,
|
||||
mcs: Type[ModelFormMetaclass], name: str, bases: Tuple[Type[ModelForm]], attrs: OrderedDict
|
||||
) -> Type[ModelForm]: ...
|
||||
|
||||
class BaseModelForm(BaseForm):
|
||||
@@ -93,9 +73,7 @@ class BaseModelForm(BaseForm):
|
||||
QueryDict,
|
||||
]
|
||||
] = ...,
|
||||
files: Optional[
|
||||
Union[Dict[str, SimpleUploadedFile], MultiValueDict]
|
||||
] = ...,
|
||||
files: Optional[Union[Dict[str, SimpleUploadedFile], MultiValueDict]] = ...,
|
||||
auto_id: Union[bool, str] = ...,
|
||||
prefix: None = ...,
|
||||
initial: Optional[Union[Dict[str, List[int]], Dict[str, int]]] = ...,
|
||||
@@ -245,19 +223,10 @@ class InlineForeignKeyField(Field):
|
||||
pk_field: bool = ...
|
||||
to_field: Optional[str] = ...
|
||||
def __init__(
|
||||
self,
|
||||
parent_instance: Model,
|
||||
*args: Any,
|
||||
pk_field: bool = ...,
|
||||
to_field: Optional[Any] = ...,
|
||||
**kwargs: Any
|
||||
self, parent_instance: Model, *args: Any, pk_field: bool = ..., to_field: Optional[Any] = ..., **kwargs: Any
|
||||
) -> None: ...
|
||||
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: ...
|
||||
def has_changed(self, initial: Optional[Union[int, str]], data: Optional[Union[int, str]]) -> bool: ...
|
||||
|
||||
class ModelChoiceIterator:
|
||||
field: django.forms.models.ModelChoiceField = ...
|
||||
@@ -300,28 +269,16 @@ class ModelChoiceField(ChoiceField):
|
||||
limit_choices_to: Optional[Any] = ...,
|
||||
**kwargs: Any
|
||||
) -> None: ...
|
||||
def get_limit_choices_to(
|
||||
self
|
||||
) -> Optional[Union[Dict[str, datetime], Q, MagicMock]]: ...
|
||||
def get_limit_choices_to(self) -> Optional[Union[Dict[str, datetime], Q, MagicMock]]: ...
|
||||
def __deepcopy__(
|
||||
self,
|
||||
memo: Dict[
|
||||
int, Union[List[Union[Field, Widget]], OrderedDict, Field, Widget]
|
||||
],
|
||||
self, 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: Any) -> Any: ...
|
||||
def to_python(
|
||||
self,
|
||||
value: Optional[Union[List[Dict[str, str]], List[List[str]], int, str]],
|
||||
) -> Optional[Model]: ...
|
||||
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: ...
|
||||
def has_changed(self, initial: Optional[Union[Model, int, str, UUID]], data: Optional[Union[int, str]]) -> bool: ...
|
||||
|
||||
class ModelMultipleChoiceField(ModelChoiceField):
|
||||
disabled: bool
|
||||
@@ -337,22 +294,9 @@ class ModelMultipleChoiceField(ModelChoiceField):
|
||||
hidden_widget: Any = ...
|
||||
default_error_messages: Any = ...
|
||||
def __init__(self, queryset: QuerySet, **kwargs: Any) -> None: ...
|
||||
def to_python(
|
||||
self, value: Union[List[str], Tuple[int, ...]]
|
||||
) -> List[Model]: ...
|
||||
def clean(
|
||||
self,
|
||||
value: Optional[
|
||||
Union[
|
||||
List[Dict[str, str]], List[List[str]], List[Model], Tuple, str
|
||||
]
|
||||
],
|
||||
) -> QuerySet: ...
|
||||
def prepare_value(
|
||||
self, value: Any
|
||||
) -> Optional[Union[List[Dict[str, str]], List[List[str]], int, str]]: ...
|
||||
def to_python(self, value: Union[List[str], Tuple[int, ...]]) -> List[Model]: ...
|
||||
def clean(self, value: Optional[Union[List[Dict[str, str]], List[List[str]], List[Model], Tuple, str]]) -> QuerySet: ...
|
||||
def prepare_value(self, value: Any) -> Optional[Union[List[Dict[str, str]], List[List[str]], int, str]]: ...
|
||||
def has_changed(
|
||||
self,
|
||||
initial: Optional[Union[List[Model], QuerySet, str]],
|
||||
data: Optional[Union[List[int], List[str], str]],
|
||||
self, initial: Optional[Union[List[Model], QuerySet, str]], data: Optional[Union[List[int], List[str], str]]
|
||||
) -> bool: ...
|
||||
|
||||
@@ -18,20 +18,7 @@ class BaseRenderer:
|
||||
str,
|
||||
Union[
|
||||
Dict[
|
||||
str,
|
||||
Optional[
|
||||
Union[
|
||||
Dict[str, bool],
|
||||
List[
|
||||
Dict[
|
||||
str,
|
||||
Optional[Union[Dict[str, str], bool, str]],
|
||||
]
|
||||
],
|
||||
bool,
|
||||
str,
|
||||
]
|
||||
],
|
||||
str, Optional[Union[Dict[str, bool], List[Dict[str, Optional[Union[Dict[str, str], bool, str]]]], bool, str]]
|
||||
],
|
||||
Dict[
|
||||
str,
|
||||
@@ -42,22 +29,7 @@ class BaseRenderer:
|
||||
str,
|
||||
Union[
|
||||
Dict[str, Union[bool, str]],
|
||||
List[
|
||||
Tuple[
|
||||
None,
|
||||
List[
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
Dict[str, bool],
|
||||
bool,
|
||||
str,
|
||||
],
|
||||
]
|
||||
],
|
||||
int,
|
||||
]
|
||||
],
|
||||
List[Tuple[None, List[Dict[str, Union[Dict[str, bool], bool, str]]], int]],
|
||||
List[str],
|
||||
bool,
|
||||
str,
|
||||
@@ -73,38 +45,13 @@ class BaseRenderer:
|
||||
str,
|
||||
Union[
|
||||
Dict[str, Union[int, str]],
|
||||
List[
|
||||
Tuple[
|
||||
Optional[str],
|
||||
List[
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
Dict[str, Union[bool, str]],
|
||||
time,
|
||||
int,
|
||||
str,
|
||||
],
|
||||
]
|
||||
],
|
||||
int,
|
||||
]
|
||||
],
|
||||
List[Tuple[Optional[str], List[Dict[str, Union[Dict[str, Union[bool, str]], time, int, str]]], int]],
|
||||
List[str],
|
||||
int,
|
||||
str,
|
||||
],
|
||||
],
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
Dict[str, str],
|
||||
List[Dict[str, Union[Dict[str, str], bool, str]]],
|
||||
List[int],
|
||||
bool,
|
||||
str,
|
||||
],
|
||||
],
|
||||
Dict[str, Union[Dict[str, str], List[Dict[str, Union[Dict[str, str], bool, str]]], List[int], bool, str]],
|
||||
],
|
||||
],
|
||||
request: None = ...,
|
||||
|
||||
@@ -5,15 +5,12 @@ from typing import Any, Callable, Dict, List, Optional, Tuple, Type, Union
|
||||
from django.core.exceptions import ValidationError
|
||||
from django.utils.safestring import SafeText
|
||||
|
||||
|
||||
def pretty_name(name: str) -> str: ...
|
||||
def flatatt(attrs: Dict[str, Optional[str]]) -> SafeText: ...
|
||||
|
||||
class ErrorDict(dict):
|
||||
def as_data(self) -> Dict[str, List[ValidationError]]: ...
|
||||
def get_json_data(
|
||||
self, escape_html: bool = ...
|
||||
) -> Dict[str, List[Dict[str, str]]]: ...
|
||||
def get_json_data(self, escape_html: bool = ...) -> Dict[str, List[Dict[str, str]]]: ...
|
||||
def as_json(self, escape_html: bool = ...) -> str: ...
|
||||
def as_ul(self) -> str: ...
|
||||
def as_text(self) -> str: ...
|
||||
@@ -22,16 +19,10 @@ class ErrorList(UserList, list):
|
||||
data: List[Union[django.core.exceptions.ValidationError, str]]
|
||||
error_class: str = ...
|
||||
def __init__(
|
||||
self,
|
||||
initlist: Optional[
|
||||
Union[List[ValidationError], List[str], ErrorList]
|
||||
] = ...,
|
||||
error_class: Optional[str] = ...,
|
||||
self, initlist: Optional[Union[List[ValidationError], List[str], ErrorList]] = ..., error_class: Optional[str] = ...
|
||||
) -> None: ...
|
||||
def as_data(self) -> List[ValidationError]: ...
|
||||
def get_json_data(
|
||||
self, escape_html: bool = ...
|
||||
) -> List[Dict[str, str]]: ...
|
||||
def get_json_data(self, escape_html: bool = ...) -> List[Dict[str, str]]: ...
|
||||
def as_json(self, escape_html: bool = ...) -> str: ...
|
||||
def as_ul(self) -> str: ...
|
||||
def as_text(self) -> str: ...
|
||||
@@ -40,13 +31,7 @@ class ErrorList(UserList, list):
|
||||
def __getitem__(self, i: Union[int, str]) -> str: ...
|
||||
def __reduce_ex__(
|
||||
self, *args: Any, **kwargs: Any
|
||||
) -> Tuple[
|
||||
Callable,
|
||||
Tuple[Type[ErrorList]],
|
||||
Dict[str, Union[List[ValidationError], str]],
|
||||
None,
|
||||
None,
|
||||
]: ...
|
||||
) -> Tuple[Callable, Tuple[Type[ErrorList]], Dict[str, Union[List[ValidationError], str]], None, None]: ...
|
||||
|
||||
def from_current_timezone(value: datetime) -> datetime: ...
|
||||
def to_current_timezone(value: datetime) -> datetime: ...
|
||||
|
||||
@@ -2,8 +2,7 @@ from collections import OrderedDict
|
||||
from datetime import date, datetime, time
|
||||
from decimal import Decimal
|
||||
from itertools import chain
|
||||
from typing import (Any, Callable, Dict, Iterator, List, Optional, Set, Tuple,
|
||||
Type, Union)
|
||||
from typing import Any, Callable, Dict, Iterator, List, Optional, Set, Tuple, Type, Union
|
||||
|
||||
from django.contrib.admin.options import BaseModelAdmin
|
||||
from django.core.files.base import File
|
||||
@@ -16,7 +15,6 @@ from django.http.request import QueryDict
|
||||
from django.utils.datastructures import MultiValueDict
|
||||
from django.utils.safestring import SafeText
|
||||
|
||||
|
||||
class MediaOrderConflictWarning(RuntimeWarning): ...
|
||||
|
||||
class Media:
|
||||
@@ -33,8 +31,7 @@ class Media:
|
||||
def __getitem__(self, name: str) -> Media: ...
|
||||
@staticmethod
|
||||
def merge(
|
||||
list_1: Union[List[int], List[str], Tuple[str]],
|
||||
list_2: Union[List[int], List[str], Tuple[str]],
|
||||
list_1: Union[List[int], List[str], Tuple[str]], list_2: Union[List[int], List[str], Tuple[str]]
|
||||
) -> Union[List[int], List[str]]: ...
|
||||
def __add__(self, other: Media) -> Media: ...
|
||||
|
||||
@@ -49,15 +46,8 @@ class Widget:
|
||||
is_required: bool = ...
|
||||
supports_microseconds: bool = ...
|
||||
attrs: Dict[Any, Any] = ...
|
||||
def __init__(
|
||||
self,
|
||||
attrs: Optional[
|
||||
Union[Dict[str, None], Dict[str, bool], Dict[str, float]]
|
||||
] = ...,
|
||||
) -> None: ...
|
||||
def __deepcopy__(
|
||||
self, memo: Dict[int, Union[Dict[Any, Any], List[Any]]]
|
||||
) -> Widget: ...
|
||||
def __init__(self, attrs: Optional[Union[Dict[str, None], Dict[str, bool], Dict[str, float]]] = ...) -> None: ...
|
||||
def __deepcopy__(self, memo: Dict[int, Union[Dict[Any, Any], List[Any]]]) -> Widget: ...
|
||||
@property
|
||||
def is_hidden(self) -> bool: ...
|
||||
def subwidgets(
|
||||
@@ -65,10 +55,7 @@ class Widget:
|
||||
) -> Iterator[Dict[str, Optional[Union[Dict[str, bool], bool, str]]]]: ...
|
||||
def format_value(self, value: Any) -> Optional[str]: ...
|
||||
def get_context(
|
||||
self,
|
||||
name: str,
|
||||
value: Any,
|
||||
attrs: Optional[Dict[str, Union[bool, str]]],
|
||||
self, name: str, value: Any, attrs: Optional[Dict[str, Union[bool, str]]]
|
||||
) -> Dict[
|
||||
str,
|
||||
Union[
|
||||
@@ -80,29 +67,16 @@ class Widget:
|
||||
],
|
||||
]: ...
|
||||
def render(
|
||||
self,
|
||||
name: str,
|
||||
value: Any,
|
||||
attrs: Optional[Dict[str, Union[bool, str]]] = ...,
|
||||
renderer: Optional[EngineMixin] = ...,
|
||||
self, name: str, value: Any, attrs: Optional[Dict[str, Union[bool, str]]] = ..., renderer: Optional[EngineMixin] = ...
|
||||
) -> SafeText: ...
|
||||
def build_attrs(
|
||||
self,
|
||||
base_attrs: Dict[str, Union[float, str]],
|
||||
extra_attrs: Optional[Dict[str, Union[bool, str]]] = ...,
|
||||
self, base_attrs: Dict[str, Union[float, str]], extra_attrs: Optional[Dict[str, Union[bool, str]]] = ...
|
||||
) -> Dict[str, Union[Decimal, float, str]]: ...
|
||||
def value_from_datadict(
|
||||
self,
|
||||
data: dict,
|
||||
files: Union[Dict[str, SimpleUploadedFile], MultiValueDict],
|
||||
name: str,
|
||||
) -> Any: ...
|
||||
def value_from_datadict(self, data: dict, files: Union[Dict[str, SimpleUploadedFile], MultiValueDict], name: str) -> Any: ...
|
||||
def value_omitted_from_data(
|
||||
self,
|
||||
data: Union[
|
||||
Dict[str, Optional[Union[List[int], date, int, str]]],
|
||||
Dict[str, Union[datetime, Decimal, int, str]],
|
||||
QueryDict,
|
||||
Dict[str, Optional[Union[List[int], date, int, str]]], Dict[str, Union[datetime, Decimal, int, str]], QueryDict
|
||||
],
|
||||
files: Union[Dict[str, SimpleUploadedFile], MultiValueDict],
|
||||
name: str,
|
||||
@@ -115,21 +89,10 @@ class Input(Widget):
|
||||
input_type: str = ...
|
||||
template_name: str = ...
|
||||
def __init__(
|
||||
self,
|
||||
attrs: Optional[
|
||||
Union[
|
||||
Dict[str, None],
|
||||
Dict[str, bool],
|
||||
Dict[str, float],
|
||||
Dict[str, str],
|
||||
]
|
||||
] = ...,
|
||||
self, attrs: Optional[Union[Dict[str, None], Dict[str, bool], Dict[str, float], Dict[str, str]]] = ...
|
||||
) -> None: ...
|
||||
def get_context(
|
||||
self,
|
||||
name: str,
|
||||
value: Any,
|
||||
attrs: Optional[Dict[str, Union[bool, str]]],
|
||||
self, name: str, value: Any, attrs: Optional[Dict[str, Union[bool, str]]]
|
||||
) -> Dict[
|
||||
str,
|
||||
Union[
|
||||
@@ -171,17 +134,10 @@ class PasswordInput(Input):
|
||||
input_type: str = ...
|
||||
template_name: str = ...
|
||||
render_value: bool = ...
|
||||
def __init__(
|
||||
self, attrs: Optional[Dict[str, bool]] = ..., render_value: bool = ...
|
||||
) -> None: ...
|
||||
def __init__(self, attrs: Optional[Dict[str, bool]] = ..., render_value: bool = ...) -> None: ...
|
||||
def get_context(
|
||||
self,
|
||||
name: str,
|
||||
value: Optional[str],
|
||||
attrs: Optional[Dict[str, Union[bool, str]]],
|
||||
) -> Dict[
|
||||
str, Dict[str, Optional[Union[Dict[str, Union[bool, str]], bool, str]]]
|
||||
]: ...
|
||||
self, name: str, value: Optional[str], attrs: Optional[Dict[str, Union[bool, str]]]
|
||||
) -> Dict[str, Dict[str, Optional[Union[Dict[str, Union[bool, str]], bool, str]]]]: ...
|
||||
|
||||
class HiddenInput(Input):
|
||||
attrs: Dict[str, str]
|
||||
@@ -198,46 +154,18 @@ class MultipleHiddenInput(HiddenInput):
|
||||
is_required: bool
|
||||
template_name: str = ...
|
||||
def get_context(
|
||||
self,
|
||||
name: str,
|
||||
value: Optional[Union[List[int], List[str]]],
|
||||
attrs: Optional[Dict[str, str]],
|
||||
self, name: str, value: Optional[Union[List[int], List[str]]], attrs: Optional[Dict[str, str]]
|
||||
) -> Dict[
|
||||
str,
|
||||
Union[
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
Dict[str, str],
|
||||
List[Dict[str, Union[Dict[str, str], bool, str]]],
|
||||
List[int],
|
||||
bool,
|
||||
str,
|
||||
],
|
||||
],
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
Dict[str, str],
|
||||
List[Dict[str, Union[Dict[str, str], bool, str]]],
|
||||
List[str],
|
||||
bool,
|
||||
str,
|
||||
],
|
||||
],
|
||||
Dict[str, Union[Dict[str, str], List[Dict[str, Union[Dict[str, str], bool, str]]], List[int], bool, str]],
|
||||
Dict[str, Union[Dict[str, str], List[Dict[str, Union[Dict[str, str], bool, str]]], List[str], bool, str]],
|
||||
],
|
||||
]: ...
|
||||
def value_from_datadict(
|
||||
self,
|
||||
data: Union[
|
||||
Dict[str, List[str]], Dict[str, Tuple[int, ...]], MultiValueDict
|
||||
],
|
||||
files: Dict[Any, Any],
|
||||
name: str,
|
||||
self, data: Union[Dict[str, List[str]], Dict[str, Tuple[int, ...]], MultiValueDict], files: Dict[Any, Any], name: str
|
||||
) -> Union[List[str], Tuple[int, ...]]: ...
|
||||
def format_value(
|
||||
self, value: Optional[Union[List[int], List[str]]]
|
||||
) -> Union[List[int], List[str]]: ...
|
||||
def format_value(self, value: Optional[Union[List[int], List[str]]]) -> Union[List[int], List[str]]: ...
|
||||
|
||||
class FileInput(Input):
|
||||
attrs: Dict[str, Union[bool, str]]
|
||||
@@ -248,17 +176,12 @@ class FileInput(Input):
|
||||
def format_value(self, value: Optional[str]) -> None: ...
|
||||
def value_from_datadict(
|
||||
self,
|
||||
data: Union[
|
||||
Dict[str, None], Dict[str, bool], Dict[str, str], QueryDict
|
||||
],
|
||||
data: Union[Dict[str, None], Dict[str, bool], Dict[str, str], QueryDict],
|
||||
files: Dict[str, Union[SimpleUploadedFile, str]],
|
||||
name: str,
|
||||
) -> Optional[Union[SimpleUploadedFile, str]]: ...
|
||||
def value_omitted_from_data(
|
||||
self,
|
||||
data: Dict[str, str],
|
||||
files: Dict[str, Union[SimpleUploadedFile, str]],
|
||||
name: str,
|
||||
self, data: Dict[str, str], files: Dict[str, Union[SimpleUploadedFile, str]], name: str
|
||||
) -> bool: ...
|
||||
|
||||
class ClearableFileInput(FileInput):
|
||||
@@ -271,48 +194,31 @@ class ClearableFileInput(FileInput):
|
||||
def clear_checkbox_name(self, name: str) -> str: ...
|
||||
def clear_checkbox_id(self, name: str) -> str: ...
|
||||
def is_initial(self, value: Optional[Union[File, str]]) -> bool: ...
|
||||
def format_value(
|
||||
self, value: Optional[Union[File, str]]
|
||||
) -> Optional[FieldFile]: ...
|
||||
def format_value(self, value: Optional[Union[File, str]]) -> Optional[FieldFile]: ...
|
||||
def get_context(self, name: Any, value: Any, attrs: Any): ...
|
||||
def value_from_datadict(
|
||||
self,
|
||||
data: Union[
|
||||
Dict[str, None], Dict[str, bool], Dict[str, str], QueryDict
|
||||
],
|
||||
data: Union[Dict[str, None], Dict[str, bool], Dict[str, str], QueryDict],
|
||||
files: Dict[str, Union[SimpleUploadedFile, str]],
|
||||
name: str,
|
||||
) -> Any: ...
|
||||
def use_required_attribute(
|
||||
self, initial: Optional[Union[FieldFile, str]]
|
||||
) -> bool: ...
|
||||
def use_required_attribute(self, initial: Optional[Union[FieldFile, str]]) -> bool: ...
|
||||
def value_omitted_from_data(
|
||||
self,
|
||||
data: Dict[str, str],
|
||||
files: Dict[str, Union[SimpleUploadedFile, str]],
|
||||
name: str,
|
||||
self, data: Dict[str, str], files: Dict[str, Union[SimpleUploadedFile, str]], name: str
|
||||
) -> bool: ...
|
||||
|
||||
class Textarea(Widget):
|
||||
attrs: Dict[str, Union[int, str]]
|
||||
is_required: bool
|
||||
template_name: str = ...
|
||||
def __init__(
|
||||
self, attrs: Optional[Union[Dict[str, int], Dict[str, str]]] = ...
|
||||
) -> None: ...
|
||||
def __init__(self, attrs: Optional[Union[Dict[str, int], Dict[str, str]]] = ...) -> None: ...
|
||||
|
||||
class DateTimeBaseInput(TextInput):
|
||||
format_key: str = ...
|
||||
supports_microseconds: bool = ...
|
||||
format: Any = ...
|
||||
def __init__(
|
||||
self,
|
||||
attrs: Optional[Dict[str, Union[int, str]]] = ...,
|
||||
format: Optional[str] = ...,
|
||||
) -> None: ...
|
||||
def format_value(
|
||||
self, value: Optional[Union[datetime, str]]
|
||||
) -> Optional[str]: ...
|
||||
def __init__(self, attrs: Optional[Dict[str, Union[int, str]]] = ..., format: Optional[str] = ...) -> None: ...
|
||||
def format_value(self, value: Optional[Union[datetime, str]]) -> Optional[str]: ...
|
||||
|
||||
class DateInput(DateTimeBaseInput):
|
||||
attrs: Dict[str, str]
|
||||
@@ -347,35 +253,20 @@ class CheckboxInput(Input):
|
||||
input_type: str = ...
|
||||
template_name: str = ...
|
||||
check_test: Callable = ...
|
||||
def __init__(
|
||||
self,
|
||||
attrs: Optional[Dict[str, str]] = ...,
|
||||
check_test: Optional[Callable] = ...,
|
||||
) -> None: ...
|
||||
def format_value(
|
||||
self, value: Optional[Union[int, str]]
|
||||
) -> Optional[str]: ...
|
||||
def __init__(self, attrs: Optional[Dict[str, str]] = ..., check_test: Optional[Callable] = ...) -> None: ...
|
||||
def format_value(self, value: Optional[Union[int, str]]) -> Optional[str]: ...
|
||||
def get_context(
|
||||
self,
|
||||
name: str,
|
||||
value: Optional[Union[int, str]],
|
||||
attrs: Optional[Dict[str, Union[bool, str]]],
|
||||
) -> Dict[
|
||||
str, Dict[str, Optional[Union[Dict[str, Union[bool, str]], bool, str]]]
|
||||
]: ...
|
||||
self, name: str, value: Optional[Union[int, str]], attrs: Optional[Dict[str, Union[bool, str]]]
|
||||
) -> Dict[str, Dict[str, Optional[Union[Dict[str, Union[bool, str]], bool, str]]]]: ...
|
||||
def value_from_datadict(
|
||||
self,
|
||||
data: Union[
|
||||
Dict[str, Optional[Union[List[int], datetime, int, str]]], QueryDict
|
||||
],
|
||||
data: Union[Dict[str, Optional[Union[List[int], datetime, int, str]]], QueryDict],
|
||||
files: Union[Dict[str, SimpleUploadedFile], MultiValueDict],
|
||||
name: str,
|
||||
) -> bool: ...
|
||||
def value_omitted_from_data(
|
||||
self,
|
||||
data: Union[
|
||||
Dict[str, Optional[Union[List[int], datetime, int, str]]], QueryDict
|
||||
],
|
||||
data: Union[Dict[str, Optional[Union[List[int], datetime, int, str]]], QueryDict],
|
||||
files: Union[Dict[Any, Any], MultiValueDict],
|
||||
name: str,
|
||||
) -> bool: ...
|
||||
@@ -392,39 +283,14 @@ class ChoiceWidget(Widget):
|
||||
def __init__(
|
||||
self,
|
||||
attrs: Optional[Dict[str, Union[bool, str]]] = ...,
|
||||
choices: Union[
|
||||
Iterator[Any],
|
||||
List[List[Union[int, str]]],
|
||||
List[Tuple[Union[time, int], int]],
|
||||
List[int],
|
||||
Tuple,
|
||||
] = ...,
|
||||
choices: Union[Iterator[Any], List[List[Union[int, str]]], List[Tuple[Union[time, int], int]], List[int], Tuple] = ...,
|
||||
) -> None: ...
|
||||
def __deepcopy__(self, memo: Dict[int, List[Any]]) -> ChoiceWidget: ...
|
||||
def subwidgets(
|
||||
self,
|
||||
name: str,
|
||||
value: Optional[List[str]],
|
||||
attrs: Dict[str, Union[bool, str]] = ...,
|
||||
) -> None: ...
|
||||
def options(
|
||||
self,
|
||||
name: str,
|
||||
value: List[str],
|
||||
attrs: Dict[str, Union[bool, str]] = ...,
|
||||
) -> None: ...
|
||||
def subwidgets(self, name: str, value: Optional[List[str]], attrs: Dict[str, Union[bool, str]] = ...) -> None: ...
|
||||
def options(self, name: str, value: List[str], attrs: Dict[str, Union[bool, str]] = ...) -> None: ...
|
||||
def optgroups(
|
||||
self,
|
||||
name: str,
|
||||
value: List[str],
|
||||
attrs: Optional[Dict[str, Union[bool, str]]] = ...,
|
||||
) -> List[
|
||||
Tuple[
|
||||
Optional[str],
|
||||
List[Dict[str, Union[Dict[str, Union[bool, str]], time, int, str]]],
|
||||
int,
|
||||
]
|
||||
]: ...
|
||||
self, name: str, value: List[str], attrs: Optional[Dict[str, Union[bool, str]]] = ...
|
||||
) -> List[Tuple[Optional[str], List[Dict[str, Union[Dict[str, Union[bool, str]], time, int, str]]], int]]: ...
|
||||
def create_option(
|
||||
self,
|
||||
name: str,
|
||||
@@ -434,17 +300,7 @@ class ChoiceWidget(Widget):
|
||||
index: int,
|
||||
subindex: Optional[int] = ...,
|
||||
attrs: Optional[Dict[str, Union[bool, str]]] = ...,
|
||||
) -> Dict[
|
||||
str,
|
||||
Union[
|
||||
Dict[str, Union[bool, str]],
|
||||
Dict[str, bool],
|
||||
Set[str],
|
||||
time,
|
||||
int,
|
||||
str,
|
||||
],
|
||||
]: ...
|
||||
) -> Dict[str, Union[Dict[str, Union[bool, str]], Dict[str, bool], Set[str], time, int, str]]: ...
|
||||
def get_context(
|
||||
self,
|
||||
name: str,
|
||||
@@ -460,8 +316,7 @@ class ChoiceWidget(Widget):
|
||||
Tuple[
|
||||
Optional[str],
|
||||
Union[
|
||||
List[Dict[str, Union[Dict[str, bool], bool, str]]],
|
||||
List[Dict[str, Union[Dict[str, str], bool, str]]],
|
||||
List[Dict[str, Union[Dict[str, bool], bool, str]]], List[Dict[str, Union[Dict[str, str], bool, str]]]
|
||||
],
|
||||
int,
|
||||
]
|
||||
@@ -474,15 +329,9 @@ class ChoiceWidget(Widget):
|
||||
]: ...
|
||||
def id_for_label(self, id_: str, index: str = ...) -> str: ...
|
||||
def value_from_datadict(
|
||||
self,
|
||||
data: dict,
|
||||
files: Union[Dict[Any, Any], MultiValueDict],
|
||||
name: str,
|
||||
self, data: dict, files: Union[Dict[Any, Any], MultiValueDict], name: str
|
||||
) -> Optional[Union[List[str], int, str]]: ...
|
||||
def format_value(
|
||||
self,
|
||||
value: Optional[Union[List[int], List[str], Tuple[str, str], int, str]],
|
||||
) -> List[str]: ...
|
||||
def format_value(self, value: Optional[Union[List[int], List[str], Tuple[str, str], int, str]]) -> List[str]: ...
|
||||
|
||||
class Select(ChoiceWidget):
|
||||
attrs: Dict[str, Union[bool, str]]
|
||||
@@ -500,27 +349,14 @@ class Select(ChoiceWidget):
|
||||
checked_attribute: Any = ...
|
||||
option_inherits_attrs: bool = ...
|
||||
def get_context(
|
||||
self,
|
||||
name: str,
|
||||
value: Optional[Union[List[int], List[str], int, str]],
|
||||
attrs: Optional[Dict[str, Union[bool, str]]],
|
||||
self, name: str, value: Optional[Union[List[int], List[str], int, str]], attrs: Optional[Dict[str, Union[bool, str]]]
|
||||
) -> Dict[
|
||||
str,
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
Dict[str, Union[bool, str]],
|
||||
List[
|
||||
Tuple[
|
||||
Optional[str],
|
||||
List[
|
||||
Dict[
|
||||
str, Union[Dict[str, bool], Set[str], int, str]
|
||||
]
|
||||
],
|
||||
int,
|
||||
]
|
||||
],
|
||||
List[Tuple[Optional[str], List[Dict[str, Union[Dict[str, bool], Set[str], int, str]]], int]],
|
||||
List[str],
|
||||
bool,
|
||||
str,
|
||||
@@ -534,44 +370,26 @@ class NullBooleanSelect(Select):
|
||||
def __init__(self, attrs: None = ...) -> None: ...
|
||||
def format_value(self, value: Optional[Union[bool, str]]) -> str: ...
|
||||
def value_from_datadict(
|
||||
self,
|
||||
data: Union[Dict[str, Union[bool, str]], QueryDict],
|
||||
files: Union[Dict[Any, Any], MultiValueDict],
|
||||
name: str,
|
||||
self, data: Union[Dict[str, Union[bool, str]], QueryDict], files: Union[Dict[Any, Any], MultiValueDict], name: str
|
||||
) -> Optional[bool]: ...
|
||||
|
||||
class SelectMultiple(Select):
|
||||
attrs: Dict[Any, Any]
|
||||
choices: Union[
|
||||
List[Tuple[str, Union[Tuple[Tuple[str, str], Tuple[str, str]], str]]],
|
||||
django.forms.models.ModelChoiceIterator,
|
||||
]
|
||||
choices: Union[List[Tuple[str, Union[Tuple[Tuple[str, str], Tuple[str, str]], str]]], django.forms.models.ModelChoiceIterator]
|
||||
is_required: bool
|
||||
allow_multiple_selected: bool = ...
|
||||
def value_from_datadict(
|
||||
self,
|
||||
data: Union[
|
||||
Dict[str, List[int]],
|
||||
Dict[str, Tuple[int, ...]],
|
||||
Dict[str, str],
|
||||
QueryDict,
|
||||
],
|
||||
data: Union[Dict[str, List[int]], Dict[str, Tuple[int, ...]], Dict[str, str], QueryDict],
|
||||
files: Union[Dict[Any, Any], MultiValueDict],
|
||||
name: str,
|
||||
) -> Optional[Union[List[int], List[str], str]]: ...
|
||||
def value_omitted_from_data(
|
||||
self, data: Dict[str, str], files: Dict[Any, Any], name: str
|
||||
) -> bool: ...
|
||||
def value_omitted_from_data(self, data: Dict[str, str], files: Dict[Any, Any], name: str) -> bool: ...
|
||||
|
||||
class RadioSelect(ChoiceWidget):
|
||||
attrs: Dict[str, str]
|
||||
choices: Union[
|
||||
List[
|
||||
Tuple[
|
||||
datetime.time,
|
||||
Union[Tuple[Tuple[str, str], Tuple[str, str]], str],
|
||||
]
|
||||
],
|
||||
List[Tuple[datetime.time, Union[Tuple[Tuple[str, str], Tuple[str, str]], str]]],
|
||||
List[int],
|
||||
django.forms.models.ModelChoiceIterator,
|
||||
]
|
||||
@@ -583,13 +401,7 @@ class RadioSelect(ChoiceWidget):
|
||||
class CheckboxSelectMultiple(ChoiceWidget):
|
||||
attrs: Dict[str, str]
|
||||
choices: Union[
|
||||
List[
|
||||
Tuple[
|
||||
datetime.time,
|
||||
Union[Tuple[Tuple[str, str], Tuple[str, str]], str],
|
||||
]
|
||||
],
|
||||
django.forms.models.ModelChoiceIterator,
|
||||
List[Tuple[datetime.time, Union[Tuple[Tuple[str, str], Tuple[str, str]], str]]], django.forms.models.ModelChoiceIterator
|
||||
]
|
||||
is_required: bool
|
||||
allow_multiple_selected: bool = ...
|
||||
@@ -597,9 +409,7 @@ class CheckboxSelectMultiple(ChoiceWidget):
|
||||
template_name: str = ...
|
||||
option_template_name: str = ...
|
||||
def use_required_attribute(self, initial: Optional[List[str]]) -> bool: ...
|
||||
def value_omitted_from_data(
|
||||
self, data: Dict[str, str], files: Dict[Any, Any], name: str
|
||||
) -> bool: ...
|
||||
def value_omitted_from_data(self, data: Dict[str, str], files: Dict[Any, Any], name: str) -> bool: ...
|
||||
def id_for_label(self, id_: str, index: Optional[str] = ...) -> str: ...
|
||||
|
||||
class MultiWidget(Widget):
|
||||
@@ -608,18 +418,13 @@ class MultiWidget(Widget):
|
||||
widgets: List[django.forms.widgets.Widget] = ...
|
||||
def __init__(
|
||||
self,
|
||||
widgets: Union[
|
||||
List[Type[DateTimeBaseInput]], Tuple[Union[Type[TextInput], Input]]
|
||||
],
|
||||
widgets: Union[List[Type[DateTimeBaseInput]], Tuple[Union[Type[TextInput], Input]]],
|
||||
attrs: Optional[Dict[str, str]] = ...,
|
||||
) -> None: ...
|
||||
@property
|
||||
def is_hidden(self) -> bool: ...
|
||||
def get_context(
|
||||
self,
|
||||
name: str,
|
||||
value: Optional[Union[List[datetime], datetime, str]],
|
||||
attrs: Optional[Dict[str, Union[bool, str]]],
|
||||
self, name: str, value: Optional[Union[List[datetime], datetime, str]], attrs: Optional[Dict[str, Union[bool, str]]]
|
||||
) -> Dict[
|
||||
str,
|
||||
Union[
|
||||
@@ -628,16 +433,7 @@ class MultiWidget(Widget):
|
||||
Optional[
|
||||
Union[
|
||||
Dict[str, Union[bool, str]],
|
||||
List[
|
||||
Dict[
|
||||
str,
|
||||
Optional[
|
||||
Union[
|
||||
Dict[str, Union[bool, str]], bool, str
|
||||
]
|
||||
],
|
||||
]
|
||||
],
|
||||
List[Dict[str, Optional[Union[Dict[str, Union[bool, str]], bool, str]]]],
|
||||
bool,
|
||||
str,
|
||||
]
|
||||
@@ -652,20 +448,7 @@ class MultiWidget(Widget):
|
||||
str,
|
||||
Union[
|
||||
Dict[Any, Any],
|
||||
List[
|
||||
Tuple[
|
||||
None,
|
||||
List[
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
Dict[str, bool], bool, str
|
||||
],
|
||||
]
|
||||
],
|
||||
int,
|
||||
]
|
||||
],
|
||||
List[Tuple[None, List[Dict[str, Union[Dict[str, bool], bool, str]]], int]],
|
||||
List[str],
|
||||
bool,
|
||||
str,
|
||||
@@ -680,27 +463,15 @@ class MultiWidget(Widget):
|
||||
]: ...
|
||||
def id_for_label(self, id_: str) -> str: ...
|
||||
def value_from_datadict(
|
||||
self,
|
||||
data: Union[Dict[str, Union[List[str], str]], QueryDict],
|
||||
files: Union[Dict[Any, Any], MultiValueDict],
|
||||
name: str,
|
||||
self, data: Union[Dict[str, Union[List[str], str]], QueryDict], files: Union[Dict[Any, Any], MultiValueDict], name: str
|
||||
) -> Union[List[None], List[str]]: ...
|
||||
def value_omitted_from_data(
|
||||
self,
|
||||
data: Union[Dict[str, str], QueryDict],
|
||||
files: Union[Dict[Any, Any], MultiValueDict],
|
||||
name: str,
|
||||
self, data: Union[Dict[str, str], QueryDict], files: Union[Dict[Any, Any], MultiValueDict], name: str
|
||||
) -> bool: ...
|
||||
def decompress(self, value: Any) -> None: ...
|
||||
media: Any = ...
|
||||
def __deepcopy__(
|
||||
self,
|
||||
memo: Dict[
|
||||
int,
|
||||
Union[
|
||||
List[Tuple[str, str]], List[Widget], OrderedDict, Field, Widget
|
||||
],
|
||||
],
|
||||
self, memo: Dict[int, Union[List[Tuple[str, str]], List[Widget], OrderedDict, Field, Widget]]
|
||||
) -> MultiWidget: ...
|
||||
@property
|
||||
def needs_multipart_form(self) -> bool: ...
|
||||
@@ -719,9 +490,7 @@ class SplitDateTimeWidget(MultiWidget):
|
||||
date_attrs: Optional[Dict[str, str]] = ...,
|
||||
time_attrs: Optional[Dict[str, str]] = ...,
|
||||
) -> None: ...
|
||||
def decompress(
|
||||
self, value: Optional[Union[datetime, str]]
|
||||
) -> Union[List[None], List[datetime]]: ...
|
||||
def decompress(self, value: Optional[Union[datetime, str]]) -> Union[List[None], List[datetime]]: ...
|
||||
|
||||
class SplitHiddenDateTimeWidget(SplitDateTimeWidget):
|
||||
attrs: Dict[Any, Any]
|
||||
@@ -760,13 +529,7 @@ class SelectDateWidget(Widget):
|
||||
empty_label: Optional[Union[Tuple[str, str], str]] = ...,
|
||||
) -> None: ...
|
||||
def get_context(self, name: Any, value: Any, attrs: Any): ...
|
||||
def format_value(
|
||||
self, value: Optional[Union[date, str]]
|
||||
) -> Dict[str, None]: ...
|
||||
def format_value(self, value: Optional[Union[date, str]]) -> Dict[str, None]: ...
|
||||
def id_for_label(self, id_: str) -> str: ...
|
||||
def value_from_datadict(
|
||||
self, data: Dict[str, str], files: Dict[Any, Any], name: str
|
||||
) -> Optional[str]: ...
|
||||
def value_omitted_from_data(
|
||||
self, data: Dict[str, str], files: Dict[Any, Any], name: str
|
||||
) -> bool: ...
|
||||
def value_from_datadict(self, data: Dict[str, str], files: Dict[Any, Any], name: str) -> Optional[str]: ...
|
||||
def value_omitted_from_data(self, data: Dict[str, str], files: Dict[Any, Any], name: str) -> bool: ...
|
||||
|
||||
Reference in New Issue
Block a user