mirror of
https://github.com/davidhalter/django-stubs.git
synced 2026-02-25 02:57:14 +08:00
better stubs
This commit is contained in:
@@ -1,58 +1,53 @@
|
||||
# Stubs for django.forms.boundfield (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
from typing import Any, Optional
|
||||
|
||||
from django.forms.fields import Field
|
||||
from django.forms.forms import Form
|
||||
from django.forms.models import ModelForm
|
||||
from django.forms.renderers import DjangoTemplates
|
||||
from django.forms.utils import ErrorList
|
||||
from django.forms.widgets import (
|
||||
ChoiceWidget,
|
||||
HiddenInput,
|
||||
SplitHiddenDateTimeWidget,
|
||||
Widget,
|
||||
)
|
||||
from django.utils.safestring import SafeText
|
||||
from typing import Any, Dict, List, Optional, Union
|
||||
|
||||
from django.core.files.uploadedfile import SimpleUploadedFile
|
||||
from django.forms.fields import Field
|
||||
from django.forms.forms import BaseForm
|
||||
from django.forms.renderers import DjangoTemplates
|
||||
from django.forms.utils import ErrorList
|
||||
from django.forms.widgets import Widget
|
||||
from django.utils.safestring import SafeText
|
||||
|
||||
|
||||
class BoundField:
|
||||
form: Any = ...
|
||||
field: Any = ...
|
||||
name: Any = ...
|
||||
html_name: Any = ...
|
||||
html_initial_name: Any = ...
|
||||
html_initial_id: Any = ...
|
||||
label: Any = ...
|
||||
help_text: Any = ...
|
||||
def __init__(self, form: Union[Form, ModelForm], field: Field, name: str) -> None: ...
|
||||
def __str__(self): ...
|
||||
initial: Any
|
||||
form: django.forms.forms.BaseForm = ...
|
||||
field: django.forms.fields.Field = ...
|
||||
name: str = ...
|
||||
html_name: str = ...
|
||||
html_initial_name: str = ...
|
||||
html_initial_id: str = ...
|
||||
label: str = ...
|
||||
help_text: str = ...
|
||||
def __init__(self, form: BaseForm, field: Field, name: str) -> None: ...
|
||||
def subwidgets(self) -> List[BoundWidget]: ...
|
||||
def __bool__(self): ...
|
||||
def __bool__(self) -> bool: ...
|
||||
def __iter__(self): ...
|
||||
def __len__(self) -> int: ...
|
||||
def __getitem__(
|
||||
self, idx: Union[slice, str, int]
|
||||
) -> Union[List[BoundWidget], BoundWidget]: ...
|
||||
) -> Union[BoundWidget, List[BoundWidget]]: ...
|
||||
@property
|
||||
def errors(self) -> ErrorList: ...
|
||||
def as_widget(
|
||||
self,
|
||||
widget: Optional[Union[HiddenInput, SplitHiddenDateTimeWidget]] = ...,
|
||||
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_textarea(self, attrs: Optional[Any] = ..., **kwargs: Any): ...
|
||||
def as_hidden(self, attrs: None = ..., **kwargs: Any) -> SafeText: ...
|
||||
@property
|
||||
def data(self) -> Any: ...
|
||||
def data(
|
||||
self
|
||||
) -> Optional[
|
||||
Union[bool, SimpleUploadedFile, List[Union[str, List[str]]], str]
|
||||
]: ...
|
||||
def value(self) -> Any: ...
|
||||
def label_tag(
|
||||
self,
|
||||
contents: Optional[SafeText] = ...,
|
||||
contents: Optional[str] = ...,
|
||||
attrs: Optional[Dict[str, str]] = ...,
|
||||
label_suffix: Optional[str] = ...,
|
||||
) -> SafeText: ...
|
||||
@@ -62,24 +57,33 @@ class BoundField:
|
||||
@property
|
||||
def auto_id(self) -> str: ...
|
||||
@property
|
||||
def id_for_label(self): ...
|
||||
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]]: ...
|
||||
|
||||
class BoundWidget:
|
||||
parent_widget: Any = ...
|
||||
data: Any = ...
|
||||
renderer: Any = ...
|
||||
parent_widget: django.forms.widgets.Widget = ...
|
||||
data: Dict[
|
||||
str, Optional[Union[str, bool, Dict[str, bool], Dict[Any, Any]]]
|
||||
] = ...
|
||||
renderer: django.forms.renderers.DjangoTemplates = ...
|
||||
def __init__(
|
||||
self, parent_widget: ChoiceWidget, data: Dict[str, Any], renderer: DjangoTemplates
|
||||
self,
|
||||
parent_widget: Widget,
|
||||
data: Dict[
|
||||
str,
|
||||
Optional[
|
||||
Union[str, bool, Dict[str, bool], Dict[str, Union[bool, str]]]
|
||||
],
|
||||
],
|
||||
renderer: DjangoTemplates,
|
||||
) -> None: ...
|
||||
def __str__(self): ...
|
||||
def tag(self, wrap_label: bool = ...) -> SafeText: ...
|
||||
@property
|
||||
def template_name(self) -> str: ...
|
||||
@property
|
||||
def id_for_label(self): ...
|
||||
def id_for_label(self) -> str: ...
|
||||
@property
|
||||
def choice_label(self) -> str: ...
|
||||
|
||||
@@ -1,30 +1,28 @@
|
||||
# Stubs for django.forms.fields (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
from typing import Any, Optional
|
||||
|
||||
from datetime import date, datetime, time, timedelta
|
||||
from decimal import Decimal
|
||||
from django.core.files.uploadedfile import SimpleUploadedFile
|
||||
from django.db.models.fields.files import FieldFile
|
||||
from django.forms.boundfield import BoundField
|
||||
from django.forms.forms import Form
|
||||
from django.forms.models import ModelForm
|
||||
from django.forms.widgets import ClearableFileInput, Input, Textarea, Widget
|
||||
from collections import OrderedDict
|
||||
from datetime import date, datetime, time
|
||||
from typing import Any, Callable, Dict, List, Optional, Tuple, Union
|
||||
|
||||
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
|
||||
|
||||
|
||||
class Field:
|
||||
initial: None
|
||||
label: None
|
||||
required: bool
|
||||
widget: Any = ...
|
||||
hidden_widget: Any = ...
|
||||
default_validators: Any = ...
|
||||
default_error_messages: Any = ...
|
||||
empty_values: Any = ...
|
||||
show_hidden_initial: Any = ...
|
||||
help_text: Any = ...
|
||||
disabled: Any = ...
|
||||
label_suffix: Any = ...
|
||||
localize: Any = ...
|
||||
show_hidden_initial: bool = ...
|
||||
help_text: str = ...
|
||||
disabled: bool = ...
|
||||
label_suffix: None = ...
|
||||
localize: bool = ...
|
||||
error_messages: Any = ...
|
||||
validators: Any = ...
|
||||
def __init__(
|
||||
@@ -40,28 +38,54 @@ class Field:
|
||||
validators: Any = ...,
|
||||
localize: bool = ...,
|
||||
disabled: bool = ...,
|
||||
label_suffix: Optional[Any] = ...,
|
||||
label_suffix: Optional[Any] = ...
|
||||
) -> None: ...
|
||||
def prepare_value(self, value: Any) -> Any: ...
|
||||
def to_python(self, value: Any) -> Any: ...
|
||||
def validate(self, value: Any) -> None: ...
|
||||
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: ...
|
||||
def clean(self, value: Any) -> Any: ...
|
||||
def clean(
|
||||
self, value: Optional[Union[List[int], int, str]]
|
||||
) -> Optional[Union[Model, int, str]]: ...
|
||||
def bound_data(
|
||||
self, data: Any, initial: Optional[Union[str, float, datetime]]
|
||||
) -> Any: ...
|
||||
self,
|
||||
data: Optional[Union[str, bool, List[str]]],
|
||||
initial: Optional[Union[int, str, datetime]],
|
||||
) -> Optional[Union[str, bool, List[str]]]: ...
|
||||
def widget_attrs(self, widget: Widget) -> Dict[Any, Any]: ...
|
||||
def has_changed(self, initial: Any, data: Optional[str]) -> bool: ...
|
||||
def has_changed(
|
||||
self,
|
||||
initial: Optional[Union[time, int, date, str]],
|
||||
data: Optional[str],
|
||||
) -> bool: ...
|
||||
def get_bound_field(
|
||||
self, form: Union[Form, ModelForm], field_name: str
|
||||
self, form: BaseForm, field_name: str
|
||||
) -> BoundField: ...
|
||||
def __deepcopy__(self, memo: Dict[int, Any]) -> Field: ...
|
||||
|
||||
class CharField(Field):
|
||||
max_length: Any = ...
|
||||
min_length: Any = ...
|
||||
strip: Any = ...
|
||||
empty_value: Any = ...
|
||||
disabled: bool
|
||||
error_messages: Dict[str, str]
|
||||
help_text: str
|
||||
initial: Optional[Union[str, Callable]]
|
||||
label: Optional[str]
|
||||
label_suffix: Optional[str]
|
||||
localize: bool
|
||||
required: bool
|
||||
show_hidden_initial: bool
|
||||
validators: List[
|
||||
Union[
|
||||
django.core.validators.BaseValidator,
|
||||
django.core.validators.ProhibitNullCharactersValidator,
|
||||
]
|
||||
]
|
||||
widget: django.forms.widgets.TextInput
|
||||
max_length: Optional[Union[str, int]] = ...
|
||||
min_length: Optional[Union[str, int]] = ...
|
||||
strip: bool = ...
|
||||
empty_value: Optional[str] = ...
|
||||
def __init__(
|
||||
self,
|
||||
*,
|
||||
@@ -69,13 +93,27 @@ class CharField(Field):
|
||||
min_length: Optional[Any] = ...,
|
||||
strip: bool = ...,
|
||||
empty_value: str = ...,
|
||||
**kwargs: Any,
|
||||
**kwargs: Any
|
||||
) -> None: ...
|
||||
def to_python(self, value: Optional[Union[int, str, Tuple]]) -> Optional[str]: ...
|
||||
def widget_attrs(self, widget: Union[Textarea, Input]) -> Dict[str, str]: ...
|
||||
def to_python(
|
||||
self, value: Optional[Union[str, List[int], int]]
|
||||
) -> Optional[str]: ...
|
||||
def widget_attrs(self, widget: Widget) -> Dict[str, str]: ...
|
||||
|
||||
class IntegerField(Field):
|
||||
widget: Any = ...
|
||||
disabled: bool
|
||||
error_messages: Dict[str, str]
|
||||
help_text: str
|
||||
initial: Optional[Union[Callable, int]]
|
||||
label: Optional[str]
|
||||
label_suffix: None
|
||||
localize: bool
|
||||
max_value: Optional[int]
|
||||
min_value: Optional[int]
|
||||
required: bool
|
||||
show_hidden_initial: bool
|
||||
validators: List[django.core.validators.BaseValidator]
|
||||
widget: django.forms.widgets.NumberInput = ...
|
||||
default_error_messages: Any = ...
|
||||
re_decimal: Any = ...
|
||||
def __init__(
|
||||
@@ -83,18 +121,51 @@ class IntegerField(Field):
|
||||
*,
|
||||
max_value: Optional[Any] = ...,
|
||||
min_value: Optional[Any] = ...,
|
||||
**kwargs: Any,
|
||||
**kwargs: Any
|
||||
) -> None: ...
|
||||
def to_python(self, value: Optional[Union[str, float]]) -> Optional[int]: ...
|
||||
def widget_attrs(self, widget: Input) -> Dict[str, Union[int, Decimal]]: ...
|
||||
def to_python(self, value: str) -> int: ...
|
||||
def widget_attrs(self, widget: Widget) -> Dict[Any, Any]: ...
|
||||
|
||||
class FloatField(IntegerField):
|
||||
disabled: bool
|
||||
error_messages: Dict[str, str]
|
||||
help_text: str
|
||||
initial: None
|
||||
label: Optional[str]
|
||||
label_suffix: None
|
||||
localize: bool
|
||||
max_value: Optional[float]
|
||||
min_value: Optional[float]
|
||||
required: bool
|
||||
show_hidden_initial: bool
|
||||
validators: List[django.core.validators.BaseValidator]
|
||||
widget: django.forms.widgets.NumberInput
|
||||
default_error_messages: Any = ...
|
||||
def to_python(self, value: str) -> Optional[float]: ...
|
||||
def validate(self, value: Optional[float]) -> None: ...
|
||||
def widget_attrs(self, widget: Input) -> Dict[str, Union[int, str]]: ...
|
||||
def to_python(self, value: Any): ...
|
||||
def validate(self, value: Any): ...
|
||||
def widget_attrs(self, widget: Any): ...
|
||||
|
||||
class DecimalField(IntegerField):
|
||||
decimal_places: Optional[int]
|
||||
disabled: bool
|
||||
error_messages: Dict[str, str]
|
||||
help_text: str
|
||||
initial: None
|
||||
label: Optional[str]
|
||||
label_suffix: None
|
||||
localize: bool
|
||||
max_digits: Optional[int]
|
||||
max_value: Optional[Union[decimal.Decimal, int]]
|
||||
min_value: Optional[Union[decimal.Decimal, int]]
|
||||
required: bool
|
||||
show_hidden_initial: bool
|
||||
validators: List[
|
||||
Union[
|
||||
django.core.validators.BaseValidator,
|
||||
django.core.validators.DecimalValidator,
|
||||
]
|
||||
]
|
||||
widget: django.forms.widgets.NumberInput
|
||||
default_error_messages: Any = ...
|
||||
def __init__(
|
||||
self,
|
||||
@@ -103,201 +174,401 @@ class DecimalField(IntegerField):
|
||||
min_value: Optional[Any] = ...,
|
||||
max_digits: Optional[Any] = ...,
|
||||
decimal_places: Optional[Any] = ...,
|
||||
**kwargs: Any,
|
||||
**kwargs: Any
|
||||
) -> None: ...
|
||||
def to_python(self, value: Optional[Union[str, float]]) -> Optional[Decimal]: ...
|
||||
def validate(self, value: Decimal) -> None: ...
|
||||
def widget_attrs(self, widget: Widget) -> Dict[str, str]: ...
|
||||
def to_python(self, value: Any): ...
|
||||
def validate(self, value: Any): ...
|
||||
def widget_attrs(self, widget: Any): ...
|
||||
|
||||
class BaseTemporalField(Field):
|
||||
input_formats: Any = ...
|
||||
def __init__(self, *, input_formats: Optional[Any] = ..., **kwargs: Any) -> None: ...
|
||||
def to_python(self, value: str) -> Union[date, time]: ...
|
||||
def __init__(
|
||||
self, *, input_formats: Optional[Any] = ..., **kwargs: Any
|
||||
) -> None: ...
|
||||
def to_python(self, value: Any): ...
|
||||
def strptime(self, value: Any, format: Any) -> None: ...
|
||||
|
||||
class DateField(BaseTemporalField):
|
||||
widget: Any = ...
|
||||
disabled: bool
|
||||
error_messages: Dict[str, str]
|
||||
help_text: str
|
||||
initial: Optional[Union[Callable, datetime.date]]
|
||||
label: Optional[str]
|
||||
label_suffix: None
|
||||
localize: bool
|
||||
required: bool
|
||||
show_hidden_initial: bool
|
||||
validators: List[Any]
|
||||
widget: django.forms.widgets.DateInput = ...
|
||||
input_formats: Any = ...
|
||||
default_error_messages: Any = ...
|
||||
def to_python(self, value: Optional[Union[date, str]]) -> Optional[date]: ...
|
||||
def strptime(self, value: str, format: str) -> date: ...
|
||||
def to_python(self, value: date) -> date: ...
|
||||
def strptime(self, value: Any, format: Any): ...
|
||||
|
||||
class TimeField(BaseTemporalField):
|
||||
widget: Any = ...
|
||||
disabled: bool
|
||||
error_messages: Dict[str, str]
|
||||
help_text: str
|
||||
initial: Optional[Callable]
|
||||
label: Optional[str]
|
||||
label_suffix: None
|
||||
localize: bool
|
||||
required: bool
|
||||
show_hidden_initial: bool
|
||||
validators: List[Any]
|
||||
widget: django.forms.widgets.TimeInput = ...
|
||||
input_formats: Any = ...
|
||||
default_error_messages: Any = ...
|
||||
def to_python(self, value: Optional[Union[str, time]]) -> Optional[time]: ...
|
||||
def strptime(self, value: str, format: str) -> time: ...
|
||||
def to_python(self, value: time) -> time: ...
|
||||
def strptime(self, value: Any, format: Any): ...
|
||||
|
||||
class DateTimeField(BaseTemporalField):
|
||||
widget: Any = ...
|
||||
disabled: bool
|
||||
error_messages: Dict[str, str]
|
||||
help_text: str
|
||||
initial: Optional[Union[Callable, datetime.datetime]]
|
||||
label: Optional[str]
|
||||
label_suffix: None
|
||||
localize: bool
|
||||
required: bool
|
||||
show_hidden_initial: bool
|
||||
validators: List[Any]
|
||||
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[str, date]]) -> Optional[datetime]: ...
|
||||
def strptime(self, value: str, format: str) -> datetime: ...
|
||||
def prepare_value(self, value: Any): ...
|
||||
def to_python(self, value: Any): ...
|
||||
def strptime(self, value: Any, format: Any): ...
|
||||
|
||||
class DurationField(Field):
|
||||
disabled: bool
|
||||
help_text: str
|
||||
initial: Optional[datetime.timedelta]
|
||||
label: None
|
||||
label_suffix: None
|
||||
localize: bool
|
||||
required: bool
|
||||
show_hidden_initial: bool
|
||||
default_error_messages: Any = ...
|
||||
def prepare_value(self, value: Optional[timedelta]) -> Optional[str]: ...
|
||||
def to_python(self, value: Union[str, int]) -> timedelta: ...
|
||||
def prepare_value(self, value: Any): ...
|
||||
def to_python(self, value: Any): ...
|
||||
|
||||
class RegexField(CharField):
|
||||
def __init__(self, regex: str, **kwargs: Any) -> None: ...
|
||||
def _get_regex(self): ...
|
||||
_regex: Any = ...
|
||||
_regex_validator: Any = ...
|
||||
def _set_regex(self, regex: str) -> None: ...
|
||||
disabled: bool
|
||||
empty_value: str
|
||||
error_messages: Dict[str, str]
|
||||
help_text: str
|
||||
initial: None
|
||||
label: None
|
||||
label_suffix: None
|
||||
localize: bool
|
||||
max_length: Optional[int]
|
||||
min_length: Optional[int]
|
||||
required: bool
|
||||
show_hidden_initial: bool
|
||||
strip: bool
|
||||
validators: List[
|
||||
Union[
|
||||
django.core.validators.BaseValidator,
|
||||
django.core.validators.ProhibitNullCharactersValidator,
|
||||
django.core.validators.RegexValidator,
|
||||
]
|
||||
]
|
||||
widget: django.forms.widgets.TextInput
|
||||
def __init__(self, regex: Any, **kwargs: Any) -> None: ...
|
||||
regex: Any = ...
|
||||
|
||||
class EmailField(CharField):
|
||||
widget: Any = ...
|
||||
disabled: bool
|
||||
empty_value: Optional[str]
|
||||
error_messages: Dict[str, str]
|
||||
help_text: str
|
||||
initial: None
|
||||
label: Optional[str]
|
||||
label_suffix: None
|
||||
localize: bool
|
||||
max_length: Optional[int]
|
||||
min_length: Optional[int]
|
||||
required: bool
|
||||
show_hidden_initial: bool
|
||||
strip: bool
|
||||
validators: List[
|
||||
Union[
|
||||
django.core.validators.EmailValidator,
|
||||
django.core.validators.BaseValidator,
|
||||
django.core.validators.ProhibitNullCharactersValidator,
|
||||
]
|
||||
]
|
||||
widget: django.forms.widgets.EmailInput = ...
|
||||
default_validators: Any = ...
|
||||
def __init__(self, **kwargs: Any) -> None: ...
|
||||
|
||||
class FileField(Field):
|
||||
disabled: bool
|
||||
help_text: str
|
||||
initial: Optional[Union[Callable, str]]
|
||||
label: Optional[str]
|
||||
label_suffix: None
|
||||
localize: bool
|
||||
required: bool
|
||||
show_hidden_initial: bool
|
||||
widget: Any = ...
|
||||
default_error_messages: Any = ...
|
||||
max_length: Any = ...
|
||||
allow_empty_file: Any = ...
|
||||
max_length: Optional[int] = ...
|
||||
allow_empty_file: bool = ...
|
||||
def __init__(
|
||||
self,
|
||||
*,
|
||||
max_length: Optional[Any] = ...,
|
||||
allow_empty_file: bool = ...,
|
||||
**kwargs: Any,
|
||||
**kwargs: Any
|
||||
) -> None: ...
|
||||
def to_python(
|
||||
self, data: Optional[Union[str, SimpleUploadedFile]]
|
||||
) -> Optional[SimpleUploadedFile]: ...
|
||||
def to_python(self, data: None) -> None: ...
|
||||
def clean(
|
||||
self,
|
||||
data: Optional[Union[bool, str, SimpleUploadedFile]],
|
||||
initial: Optional[Union[str, FieldFile]] = ...,
|
||||
) -> Any: ...
|
||||
self, data: None, initial: Optional[FieldFile] = ...
|
||||
) -> FieldFile: ...
|
||||
def bound_data(
|
||||
self, data: Union[str, SimpleUploadedFile], initial: None
|
||||
) -> Union[str, SimpleUploadedFile]: ...
|
||||
def has_changed(self, initial: Union[str, FieldFile], data: Optional[str]) -> bool: ...
|
||||
self, data: None, initial: Optional[FieldFile]
|
||||
) -> Optional[FieldFile]: ...
|
||||
def has_changed(self, initial: Optional[FieldFile], data: None) -> bool: ...
|
||||
|
||||
class ImageField(FileField):
|
||||
allow_empty_file: bool
|
||||
disabled: bool
|
||||
help_text: str
|
||||
initial: None
|
||||
label: Optional[str]
|
||||
label_suffix: None
|
||||
localize: bool
|
||||
max_length: Optional[int]
|
||||
required: bool
|
||||
show_hidden_initial: bool
|
||||
default_validators: Any = ...
|
||||
default_error_messages: Any = ...
|
||||
def to_python(self, data: Any): ...
|
||||
def widget_attrs(self, widget: ClearableFileInput) -> Dict[str, str]: ...
|
||||
def widget_attrs(self, widget: Any): ...
|
||||
|
||||
class URLField(CharField):
|
||||
widget: Any = ...
|
||||
disabled: bool
|
||||
empty_value: Optional[str]
|
||||
error_messages: Dict[str, str]
|
||||
help_text: str
|
||||
initial: None
|
||||
label: Optional[str]
|
||||
label_suffix: None
|
||||
localize: bool
|
||||
max_length: Optional[int]
|
||||
min_length: Optional[int]
|
||||
required: bool
|
||||
show_hidden_initial: bool
|
||||
strip: bool
|
||||
validators: List[
|
||||
Union[
|
||||
django.core.validators.URLValidator,
|
||||
django.core.validators.MaxLengthValidator,
|
||||
django.core.validators.ProhibitNullCharactersValidator,
|
||||
]
|
||||
]
|
||||
widget: django.forms.widgets.URLInput = ...
|
||||
default_error_messages: Any = ...
|
||||
default_validators: Any = ...
|
||||
def __init__(self, **kwargs: Any) -> None: ...
|
||||
def to_python(self, value: Optional[Union[str, int]]) -> Optional[str]: ...
|
||||
def to_python(self, value: None) -> str: ...
|
||||
|
||||
class BooleanField(Field):
|
||||
widget: Any = ...
|
||||
disabled: bool
|
||||
error_messages: Dict[str, str]
|
||||
help_text: str
|
||||
initial: Optional[int]
|
||||
label: Optional[str]
|
||||
label_suffix: None
|
||||
localize: bool
|
||||
required: bool
|
||||
show_hidden_initial: bool
|
||||
validators: List[Any]
|
||||
widget: django.forms.widgets.CheckboxInput = ...
|
||||
def to_python(self, value: Optional[Union[str, int]]) -> bool: ...
|
||||
def validate(self, value: bool) -> None: ...
|
||||
def has_changed(
|
||||
self, initial: Optional[bool], data: Optional[Union[bool, str]]
|
||||
self, initial: Optional[Union[bool, str]], data: Optional[str]
|
||||
) -> bool: ...
|
||||
|
||||
class NullBooleanField(BooleanField):
|
||||
disabled: bool
|
||||
help_text: str
|
||||
initial: Optional[bool]
|
||||
label: Optional[str]
|
||||
label_suffix: None
|
||||
localize: bool
|
||||
required: bool
|
||||
show_hidden_initial: bool
|
||||
widget: Any = ...
|
||||
def to_python(self, value: Optional[Union[str, bool]]) -> Optional[bool]: ...
|
||||
def validate(self, value: Optional[bool]) -> None: ...
|
||||
def to_python(self, value: None) -> None: ...
|
||||
def validate(self, value: None) -> None: ...
|
||||
|
||||
class CallableChoiceIterator:
|
||||
choices_func: Any = ...
|
||||
choices_func: Callable = ...
|
||||
def __init__(self, choices_func: Callable) -> None: ...
|
||||
def __iter__(self) -> None: ...
|
||||
|
||||
class ChoiceField(Field):
|
||||
widget: Any = ...
|
||||
disabled: bool
|
||||
error_messages: Dict[str, str]
|
||||
help_text: str
|
||||
initial: None
|
||||
label: Optional[str]
|
||||
label_suffix: None
|
||||
localize: bool
|
||||
required: bool
|
||||
show_hidden_initial: bool
|
||||
validators: List[Any]
|
||||
widget: django.forms.widgets.Select = ...
|
||||
default_error_messages: Any = ...
|
||||
choices: Any = ...
|
||||
def __init__(self, *, choices: Any = ..., **kwargs: Any) -> None: ...
|
||||
def __deepcopy__(self, memo: Dict[int, Any]) -> ChoiceField: ...
|
||||
def _get_choices(self) -> Any: ...
|
||||
_choices: Any = ...
|
||||
def _set_choices(self, value: Any) -> None: ...
|
||||
def to_python(self, value: Optional[str]) -> str: ...
|
||||
def to_python(self, value: Optional[Union[str, int]]) -> str: ...
|
||||
def validate(self, value: str) -> None: ...
|
||||
def valid_value(self, value: str) -> bool: ...
|
||||
|
||||
class TypedChoiceField(ChoiceField):
|
||||
coerce: Any = ...
|
||||
empty_value: Any = ...
|
||||
disabled: bool
|
||||
help_text: str
|
||||
initial: Optional[Union[Callable, int]]
|
||||
label: Optional[str]
|
||||
label_suffix: None
|
||||
localize: bool
|
||||
required: bool
|
||||
show_hidden_initial: bool
|
||||
coerce: Union[Callable, Type[Union[str, float, int]]] = ...
|
||||
empty_value: Optional[str] = ...
|
||||
def __init__(
|
||||
self, *, coerce: Any = ..., empty_value: str = ..., **kwargs: Any
|
||||
) -> None: ...
|
||||
def _coerce(self, value: Optional[Union[str, int]]) -> Optional[Union[str, int]]: ...
|
||||
def clean(self, value: Optional[str]) -> Optional[Union[str, int]]: ...
|
||||
def clean(self, value: str) -> Optional[Union[str, int]]: ...
|
||||
|
||||
class MultipleChoiceField(ChoiceField):
|
||||
disabled: bool
|
||||
error_messages: Dict[str, str]
|
||||
help_text: str
|
||||
initial: Optional[Callable]
|
||||
label: None
|
||||
label_suffix: None
|
||||
localize: bool
|
||||
required: bool
|
||||
show_hidden_initial: bool
|
||||
validators: List[Any]
|
||||
hidden_widget: Any = ...
|
||||
widget: Any = ...
|
||||
widget: django.forms.widgets.SelectMultiple = ...
|
||||
default_error_messages: Any = ...
|
||||
def to_python(self, value: Optional[Union[str, List[str], Tuple]]) -> List[str]: ...
|
||||
def validate(self, value: List[str]) -> None: ...
|
||||
def has_changed(
|
||||
self, initial: Optional[Union[str, List[int]]], data: Union[str, List[str]]
|
||||
) -> bool: ...
|
||||
def to_python(self, value: Any): ...
|
||||
def validate(self, value: Any) -> None: ...
|
||||
def has_changed(self, initial: Any, data: Any): ...
|
||||
|
||||
class TypedMultipleChoiceField(MultipleChoiceField):
|
||||
coerce: Any = ...
|
||||
empty_value: Any = ...
|
||||
disabled: bool
|
||||
help_text: str
|
||||
initial: None
|
||||
label: None
|
||||
label_suffix: None
|
||||
localize: bool
|
||||
required: bool
|
||||
show_hidden_initial: bool
|
||||
coerce: Union[Callable, Type[Union[int, float]]] = ...
|
||||
empty_value: Optional[List[Any]] = ...
|
||||
def __init__(self, *, coerce: Any = ..., **kwargs: Any) -> None: ...
|
||||
def _coerce(self, value: List[str]) -> Optional[Union[List[Decimal], List[int]]]: ...
|
||||
def clean(self, value: List[str]) -> Optional[Union[List[int], List[bool]]]: ...
|
||||
def validate(self, value: List[str]) -> None: ...
|
||||
def clean(self, value: Any): ...
|
||||
def validate(self, value: Any) -> None: ...
|
||||
|
||||
class ComboField(Field):
|
||||
disabled: bool
|
||||
help_text: str
|
||||
initial: None
|
||||
label: None
|
||||
label_suffix: None
|
||||
localize: bool
|
||||
required: bool
|
||||
show_hidden_initial: bool
|
||||
fields: Any = ...
|
||||
def __init__(self, fields: List[CharField], **kwargs: Any) -> None: ...
|
||||
def clean(self, value: Optional[str]) -> str: ...
|
||||
|
||||
class MultiValueField(Field):
|
||||
disabled: bool
|
||||
help_text: str
|
||||
initial: None
|
||||
label: None
|
||||
label_suffix: None
|
||||
localize: bool
|
||||
required: bool
|
||||
show_hidden_initial: bool
|
||||
default_error_messages: Any = ...
|
||||
require_all_fields: Any = ...
|
||||
require_all_fields: bool = ...
|
||||
fields: Any = ...
|
||||
def __init__(
|
||||
self,
|
||||
fields: Union[
|
||||
Tuple[CharField, MultipleChoiceField, SplitDateTimeField],
|
||||
Tuple[DateField, TimeField],
|
||||
Tuple[CharField, CharField],
|
||||
],
|
||||
fields: Tuple[DateField, TimeField],
|
||||
*,
|
||||
require_all_fields: bool = ...,
|
||||
**kwargs: Any,
|
||||
**kwargs: Any
|
||||
) -> None: ...
|
||||
def __deepcopy__(self, memo: Dict[int, Any]) -> MultiValueField: ...
|
||||
def validate(self, value: Union[str, datetime]) -> None: ...
|
||||
def clean(
|
||||
self, value: Union[str, List[str], List[Union[str, List[str]]]]
|
||||
) -> Optional[Union[str, datetime]]: ...
|
||||
def __deepcopy__(
|
||||
self,
|
||||
memo: Dict[
|
||||
int,
|
||||
Union[
|
||||
OrderedDict,
|
||||
Field,
|
||||
Widget,
|
||||
List[Union[Widget, Field]],
|
||||
List[Union[Widget, CharField]],
|
||||
],
|
||||
],
|
||||
) -> SplitDateTimeField: ...
|
||||
def validate(self, value: Any) -> None: ...
|
||||
def clean(self, value: Any): ...
|
||||
def compress(self, data_list: Any) -> None: ...
|
||||
def has_changed(
|
||||
self,
|
||||
initial: Optional[Union[datetime, List[None], List[str]]],
|
||||
data: Union[List[None], List[str]],
|
||||
self, initial: Optional[Union[List[None], datetime]], data: List[str]
|
||||
) -> bool: ...
|
||||
|
||||
class FilePathField(ChoiceField):
|
||||
allow_files: bool
|
||||
allow_folders: bool
|
||||
disabled: bool
|
||||
help_text: str
|
||||
initial: None
|
||||
label: Optional[str]
|
||||
label_suffix: None
|
||||
localize: bool
|
||||
match: Optional[str]
|
||||
path: str
|
||||
recursive: bool
|
||||
required: bool
|
||||
show_hidden_initial: bool
|
||||
choices: Any = ...
|
||||
match_re: Any = ...
|
||||
def __init__(
|
||||
self,
|
||||
path: str,
|
||||
path: Any,
|
||||
*,
|
||||
match: Optional[Any] = ...,
|
||||
recursive: bool = ...,
|
||||
allow_files: bool = ...,
|
||||
allow_folders: bool = ...,
|
||||
**kwargs: Any,
|
||||
**kwargs: Any
|
||||
) -> None: ...
|
||||
|
||||
class SplitDateTimeField(MultiValueField):
|
||||
disabled: bool
|
||||
help_text: str
|
||||
initial: Optional[Union[Callable, datetime.datetime]]
|
||||
label: Optional[str]
|
||||
label_suffix: None
|
||||
localize: bool
|
||||
require_all_fields: bool
|
||||
required: bool
|
||||
show_hidden_initial: bool
|
||||
widget: Any = ...
|
||||
hidden_widget: Any = ...
|
||||
default_error_messages: Any = ...
|
||||
@@ -306,24 +577,63 @@ class SplitDateTimeField(MultiValueField):
|
||||
*,
|
||||
input_date_formats: Optional[Any] = ...,
|
||||
input_time_formats: Optional[Any] = ...,
|
||||
**kwargs: Any,
|
||||
**kwargs: Any
|
||||
) -> None: ...
|
||||
def compress(self, data_list: List[Union[date, time]]) -> Optional[datetime]: ...
|
||||
def compress(self, data_list: Any): ...
|
||||
|
||||
class GenericIPAddressField(CharField):
|
||||
unpack_ipv4: Any = ...
|
||||
default_validators: Any = ...
|
||||
disabled: bool
|
||||
empty_value: str
|
||||
error_messages: Dict[str, str]
|
||||
help_text: str
|
||||
initial: None
|
||||
label: None
|
||||
label_suffix: None
|
||||
localize: bool
|
||||
max_length: None
|
||||
min_length: None
|
||||
required: bool
|
||||
show_hidden_initial: bool
|
||||
strip: bool
|
||||
validators: List[Callable]
|
||||
widget: django.forms.widgets.TextInput
|
||||
unpack_ipv4: bool = ...
|
||||
default_validators: List[Callable] = ...
|
||||
def __init__(
|
||||
self, *, protocol: str = ..., unpack_ipv4: bool = ..., **kwargs: Any
|
||||
) -> None: ...
|
||||
def to_python(self, value: str) -> str: ...
|
||||
def to_python(self, value: Any): ...
|
||||
|
||||
class SlugField(CharField):
|
||||
default_validators: Any = ...
|
||||
allow_unicode: Any = ...
|
||||
disabled: bool
|
||||
empty_value: str
|
||||
help_text: str
|
||||
initial: None
|
||||
label: Optional[str]
|
||||
label_suffix: None
|
||||
localize: bool
|
||||
max_length: Optional[int]
|
||||
min_length: None
|
||||
required: bool
|
||||
show_hidden_initial: bool
|
||||
strip: bool
|
||||
default_validators: List[django.core.validators.RegexValidator] = ...
|
||||
allow_unicode: bool = ...
|
||||
def __init__(self, *, allow_unicode: bool = ..., **kwargs: Any) -> None: ...
|
||||
|
||||
class UUIDField(CharField):
|
||||
disabled: bool
|
||||
empty_value: str
|
||||
help_text: str
|
||||
initial: Optional[Callable]
|
||||
label: Optional[str]
|
||||
label_suffix: None
|
||||
localize: bool
|
||||
max_length: None
|
||||
min_length: None
|
||||
required: bool
|
||||
show_hidden_initial: bool
|
||||
strip: bool
|
||||
default_error_messages: Any = ...
|
||||
def prepare_value(self, value: Any): ...
|
||||
def to_python(self, value: Any): ...
|
||||
|
||||
@@ -1,17 +1,7 @@
|
||||
# Stubs for django.forms.forms (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
from django.forms.widgets import MediaDefiningClass
|
||||
from typing import Any, Optional
|
||||
|
||||
from django.core.exceptions import ValidationError
|
||||
from django.core.files.uploadedfile import SimpleUploadedFile
|
||||
from django.forms.boundfield import BoundField
|
||||
from django.forms.utils import ErrorDict, ErrorList
|
||||
from django.utils.datastructures import MultiValueDict
|
||||
from django.utils.safestring import SafeText
|
||||
from typing import Any, Dict, Iterator, List, Optional, Type, Union
|
||||
from django.forms.widgets import MediaDefiningClass
|
||||
|
||||
|
||||
class DeclarativeFieldsMetaclass(MediaDefiningClass):
|
||||
def __new__(mcs: Any, name: Any, bases: Any, attrs: Any): ...
|
||||
@@ -31,58 +21,41 @@ class BaseForm:
|
||||
error_class: Any = ...
|
||||
label_suffix: Any = ...
|
||||
empty_permitted: Any = ...
|
||||
_errors: Any = ...
|
||||
fields: Any = ...
|
||||
_bound_fields_cache: Any = ...
|
||||
renderer: Any = ...
|
||||
def __init__(
|
||||
self,
|
||||
data: Any = ...,
|
||||
files: Optional[Union[MultiValueDict, Dict[str, SimpleUploadedFile]]] = ...,
|
||||
auto_id: Optional[Union[str, bool]] = ...,
|
||||
prefix: Optional[str] = ...,
|
||||
initial: Any = ...,
|
||||
error_class: Type[ErrorList] = ...,
|
||||
label_suffix: None = ...,
|
||||
data: Optional[Any] = ...,
|
||||
files: Optional[Any] = ...,
|
||||
auto_id: str = ...,
|
||||
prefix: Optional[Any] = ...,
|
||||
initial: Optional[Any] = ...,
|
||||
error_class: Any = ...,
|
||||
label_suffix: Optional[Any] = ...,
|
||||
empty_permitted: bool = ...,
|
||||
field_order: None = ...,
|
||||
use_required_attribute: Optional[bool] = ...,
|
||||
renderer: object = ...,
|
||||
field_order: Optional[Any] = ...,
|
||||
use_required_attribute: Optional[Any] = ...,
|
||||
renderer: Optional[Any] = ...,
|
||||
) -> None: ...
|
||||
def order_fields(self, field_order: Any): ...
|
||||
def __str__(self): ...
|
||||
def __repr__(self) -> str: ...
|
||||
def __iter__(self) -> Iterator[BoundField]: ...
|
||||
def __getitem__(self, name: str) -> BoundField: ...
|
||||
def __iter__(self) -> None: ...
|
||||
def __getitem__(self, name: Any): ...
|
||||
@property
|
||||
def errors(self) -> ErrorDict: ...
|
||||
def errors(self): ...
|
||||
def is_valid(self): ...
|
||||
def add_prefix(self, field_name: str) -> str: ...
|
||||
def add_initial_prefix(self, field_name: str) -> str: ...
|
||||
def _html_output(
|
||||
self,
|
||||
normal_row: str,
|
||||
error_row: str,
|
||||
row_ender: str,
|
||||
help_text_html: str,
|
||||
errors_on_separate_row: bool,
|
||||
) -> SafeText: ...
|
||||
def as_table(self) -> SafeText: ...
|
||||
def as_ul(self) -> SafeText: ...
|
||||
def as_p(self) -> SafeText: ...
|
||||
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: Optional[str], error: Union[str, ValidationError]
|
||||
) -> None: ...
|
||||
def add_error(self, field: Any, error: Any) -> None: ...
|
||||
def has_error(self, field: Any, code: Optional[Any] = ...): ...
|
||||
cleaned_data: Any = ...
|
||||
def full_clean(self) -> None: ...
|
||||
def _clean_fields(self) -> None: ...
|
||||
def _clean_form(self) -> None: ...
|
||||
def _post_clean(self) -> None: ...
|
||||
def clean(self) -> Dict[str, Any]: ...
|
||||
def full_clean(self): ...
|
||||
def clean(self): ...
|
||||
def has_changed(self): ...
|
||||
def changed_data(self) -> List[str]: ...
|
||||
def changed_data(self): ...
|
||||
@property
|
||||
def media(self): ...
|
||||
def is_multipart(self): ...
|
||||
|
||||
@@ -1,6 +1,93 @@
|
||||
from typing import Any, List
|
||||
from typing import Any, List, Optional
|
||||
|
||||
from django.forms import Form
|
||||
|
||||
|
||||
class ManagementForm(Form):
|
||||
auto_id: Union[str, bool]
|
||||
cleaned_data: Dict[str, Optional[int]]
|
||||
data: Union[
|
||||
Dict[str, Union[int, str, List[int]]], django.http.request.QueryDict
|
||||
]
|
||||
empty_permitted: bool
|
||||
error_class: Type[django.forms.utils.ErrorList]
|
||||
fields: collections.OrderedDict
|
||||
files: Dict[Any, Any]
|
||||
initial: Dict[str, int]
|
||||
is_bound: bool
|
||||
label_suffix: str
|
||||
prefix: str
|
||||
renderer: django.forms.renderers.DjangoTemplates
|
||||
def __init__(self, *args: Any, **kwargs: Any) -> None: ...
|
||||
|
||||
class BaseFormSet:
|
||||
is_bound: Any = ...
|
||||
prefix: Any = ...
|
||||
auto_id: Any = ...
|
||||
data: Any = ...
|
||||
files: Any = ...
|
||||
initial: Any = ...
|
||||
form_kwargs: Any = ...
|
||||
error_class: Any = ...
|
||||
def __init__(
|
||||
self,
|
||||
data: Optional[Any] = ...,
|
||||
files: Optional[Any] = ...,
|
||||
auto_id: str = ...,
|
||||
prefix: Optional[Any] = ...,
|
||||
initial: Optional[Any] = ...,
|
||||
error_class: Any = ...,
|
||||
form_kwargs: Optional[Any] = ...,
|
||||
) -> None: ...
|
||||
def __iter__(self): ...
|
||||
def __getitem__(self, index: Any): ...
|
||||
def __len__(self): ...
|
||||
def __bool__(self): ...
|
||||
def management_form(self): ...
|
||||
def total_form_count(self): ...
|
||||
def initial_form_count(self): ...
|
||||
def forms(self): ...
|
||||
def get_form_kwargs(self, index: Any): ...
|
||||
@property
|
||||
def initial_forms(self): ...
|
||||
@property
|
||||
def extra_forms(self): ...
|
||||
@property
|
||||
def empty_form(self): ...
|
||||
@property
|
||||
def cleaned_data(self): ...
|
||||
@property
|
||||
def deleted_forms(self): ...
|
||||
@property
|
||||
def ordered_forms(self): ...
|
||||
@classmethod
|
||||
def get_default_prefix(cls): ...
|
||||
def non_form_errors(self): ...
|
||||
@property
|
||||
def errors(self): ...
|
||||
def total_error_count(self): ...
|
||||
def is_valid(self): ...
|
||||
def full_clean(self): ...
|
||||
def clean(self) -> None: ...
|
||||
def has_changed(self): ...
|
||||
def add_fields(self, form: Any, index: Any) -> None: ...
|
||||
def add_prefix(self, index: Any): ...
|
||||
def is_multipart(self): ...
|
||||
@property
|
||||
def media(self): ...
|
||||
def as_table(self): ...
|
||||
def as_p(self): ...
|
||||
def as_ul(self): ...
|
||||
|
||||
def formset_factory(
|
||||
form: Any,
|
||||
formset: Any = ...,
|
||||
extra: int = ...,
|
||||
can_order: bool = ...,
|
||||
can_delete: bool = ...,
|
||||
max_num: Optional[Any] = ...,
|
||||
validate_max: bool = ...,
|
||||
min_num: Optional[Any] = ...,
|
||||
validate_min: bool = ...,
|
||||
): ...
|
||||
def all_valid(formsets: List[Any]) -> bool: ...
|
||||
|
||||
class ManagementForm:
|
||||
def __init__(self, *args, **kwargs) -> None: ...
|
||||
|
||||
@@ -1,95 +1,89 @@
|
||||
from collections import OrderedDict
|
||||
from django.contrib.auth.forms import UserChangeForm, UserCreationForm
|
||||
from django.core.exceptions import ValidationError
|
||||
from django.core.files.uploadedfile import SimpleUploadedFile
|
||||
from datetime import date
|
||||
from functools import partial
|
||||
from typing import (Any, Callable, Dict, Iterator, List, Optional, Tuple, Type,
|
||||
Union)
|
||||
|
||||
from django.contrib.admin.widgets import AdminTextInputWidget
|
||||
from django.contrib.auth.forms import UsernameField
|
||||
from django.contrib.auth.models import Permission
|
||||
from django.db.models.base import Model
|
||||
from django.db.models.fields.related import ForeignKey
|
||||
from django.db.models.manager import Manager
|
||||
from django.db.models.query import QuerySet
|
||||
from django.forms.fields import Field
|
||||
from django.forms.fields import CharField, ChoiceField, Field, URLField
|
||||
from django.forms.forms import BaseForm, DeclarativeFieldsMetaclass
|
||||
from django.forms.formsets import BaseFormSet
|
||||
from django.forms.utils import ErrorList
|
||||
from typing import Any, Dict, Iterator, List, Optional, Tuple, Type, Union
|
||||
from uuid import UUID
|
||||
from django.forms.widgets import Textarea, TextInput, Widget
|
||||
from django.http.request import QueryDict
|
||||
from django.utils.datastructures import MultiValueDict
|
||||
|
||||
def _get_foreign_key(
|
||||
parent_model: Type[Model],
|
||||
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]]]]: ...
|
||||
def fields_for_model(
|
||||
model: Type[Model],
|
||||
fk_name: Optional[str] = ...,
|
||||
can_fail: bool = ...,
|
||||
) -> ForeignKey: ...
|
||||
def apply_limit_choices_to_to_formfield(formfield: Field) -> None: ...
|
||||
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 = ...,
|
||||
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]]]
|
||||
] = ...,
|
||||
*,
|
||||
apply_limit_choices_to: bool = ...
|
||||
) -> OrderedDict: ...
|
||||
|
||||
class BaseModelForm:
|
||||
def __init__(
|
||||
self,
|
||||
data: Any = ...,
|
||||
files: Optional[Dict[str, SimpleUploadedFile]] = ...,
|
||||
auto_id: Union[str, bool] = ...,
|
||||
prefix: None = ...,
|
||||
initial: Optional[Dict[str, Union[Model, List[Model], QuerySet]]] = ...,
|
||||
error_class: Type[ErrorList] = ...,
|
||||
label_suffix: None = ...,
|
||||
empty_permitted: bool = ...,
|
||||
instance: Optional[Model] = ...,
|
||||
use_required_attribute: None = ...,
|
||||
renderer: None = ...,
|
||||
) -> None: ...
|
||||
def _get_validation_exclusions(self) -> List[str]: ...
|
||||
def _post_clean(self) -> None: ...
|
||||
def _save_m2m(self) -> None: ...
|
||||
def _update_errors(self, errors: ValidationError) -> None: ...
|
||||
def clean(self) -> Dict[str, Any]: ...
|
||||
def save(self, commit: bool = ...) -> Model: ...
|
||||
def validate_unique(self) -> None: ...
|
||||
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]] = ...
|
||||
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,
|
||||
],
|
||||
],
|
||||
]
|
||||
] = ...
|
||||
localized_fields: Optional[Union[str, Tuple[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[
|
||||
django.forms.fields.URLField,
|
||||
django.contrib.auth.forms.UsernameField,
|
||||
django.forms.fields.SlugField,
|
||||
]
|
||||
],
|
||||
]
|
||||
] = ...
|
||||
def __init__(self, options: Type[Any] = ...) -> None: ...
|
||||
|
||||
class InlineForeignKeyField:
|
||||
def __init__(
|
||||
self, parent_instance: Model, *args, pk_field=..., to_field=..., **kwargs
|
||||
) -> None: ...
|
||||
def clean(self, value: Optional[Union[str, int]]) -> Model: ...
|
||||
def has_changed(
|
||||
self, initial: Optional[Union[str, int]], data: Optional[Union[str, int]]
|
||||
) -> bool: ...
|
||||
|
||||
class ModelChoiceField:
|
||||
def __deepcopy__(self, memo: Dict[int, Any]) -> ModelChoiceField: ...
|
||||
def __init__(
|
||||
self,
|
||||
queryset: QuerySet,
|
||||
*,
|
||||
empty_label=...,
|
||||
required=...,
|
||||
widget=...,
|
||||
label=...,
|
||||
initial=...,
|
||||
help_text=...,
|
||||
to_field_name=...,
|
||||
limit_choices_to=...,
|
||||
**kwargs,
|
||||
) -> None: ...
|
||||
def _get_choices(self) -> ModelChoiceIterator: ...
|
||||
def _get_queryset(self) -> QuerySet: ...
|
||||
def _set_queryset(self, queryset: Union[QuerySet, Manager]) -> None: ...
|
||||
def get_limit_choices_to(self) -> Any: ...
|
||||
def has_changed(
|
||||
self, initial: Optional[Union[UUID, int]], data: Optional[Union[str, int]]
|
||||
) -> bool: ...
|
||||
def label_from_instance(self, obj: Model) -> str: ...
|
||||
def prepare_value(self, value: Any) -> Optional[Union[str, UUID, int]]: ...
|
||||
def to_python(
|
||||
self, value: Optional[Union[str, List[List[str]], int]]
|
||||
) -> Optional[Model]: ...
|
||||
def validate(self, value: Optional[Model]) -> None: ...
|
||||
|
||||
class ModelChoiceIterator:
|
||||
def __bool__(self) -> bool: ...
|
||||
def __init__(self, field: ModelChoiceField) -> None: ...
|
||||
def __iter__(self) -> Iterator[Union[Tuple[str, str], Tuple[int, str]]]: ...
|
||||
def __len__(self) -> int: ...
|
||||
def choice(self, obj: Model) -> Tuple[int, str]: ...
|
||||
|
||||
class ModelFormMetaclass:
|
||||
@staticmethod
|
||||
class ModelFormMetaclass(DeclarativeFieldsMetaclass):
|
||||
def __new__(
|
||||
mcs: Type[ModelFormMetaclass],
|
||||
name: str,
|
||||
@@ -97,132 +91,252 @@ class ModelFormMetaclass:
|
||||
attrs: OrderedDict,
|
||||
) -> Type[ModelForm]: ...
|
||||
|
||||
class ModelFormOptions:
|
||||
class BaseModelForm(BaseForm):
|
||||
instance: Any = ...
|
||||
def __init__(
|
||||
self,
|
||||
options: Optional[
|
||||
Union[Type[object], Type[UserChangeForm.Meta], Type[UserCreationForm.Meta]]
|
||||
] = ...,
|
||||
data: Optional[Union[Dict[str, str], QueryDict]] = ...,
|
||||
files: Optional[MultiValueDict] = ...,
|
||||
auto_id: str = ...,
|
||||
prefix: None = ...,
|
||||
initial: Optional[Dict[Any, Any]] = ...,
|
||||
error_class: Type[ErrorList] = ...,
|
||||
label_suffix: None = ...,
|
||||
empty_permitted: bool = ...,
|
||||
instance: Optional[Model] = ...,
|
||||
use_required_attribute: None = ...,
|
||||
renderer: None = ...,
|
||||
) -> None: ...
|
||||
def clean(self) -> Dict[str, Union[int, date]]: ...
|
||||
def validate_unique(self) -> None: ...
|
||||
save_m2m: Any = ...
|
||||
def save(self, commit: bool = ...) -> Model: ...
|
||||
|
||||
class ModelMultipleChoiceField:
|
||||
def __init__(self, queryset: QuerySet, **kwargs) -> None: ...
|
||||
def _check_values(
|
||||
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] = ...,
|
||||
): ...
|
||||
|
||||
class BaseModelFormSet(BaseFormSet):
|
||||
model: Any = ...
|
||||
unique_fields: Any = ...
|
||||
queryset: Any = ...
|
||||
initial_extra: Any = ...
|
||||
def __init__(
|
||||
self,
|
||||
value: Union[
|
||||
List[int],
|
||||
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,
|
||||
data: Optional[Any] = ...,
|
||||
files: Optional[Any] = ...,
|
||||
auto_id: str = ...,
|
||||
prefix: Optional[Any] = ...,
|
||||
queryset: Optional[Any] = ...,
|
||||
*,
|
||||
initial: Optional[Any] = ...,
|
||||
**kwargs: Any
|
||||
) -> None: ...
|
||||
def initial_form_count(self): ...
|
||||
def get_queryset(self): ...
|
||||
def save_new(self, form: Any, commit: bool = ...): ...
|
||||
def save_existing(self, form: Any, instance: Any, commit: bool = ...): ...
|
||||
def delete_existing(self, obj: Any, commit: bool = ...) -> None: ...
|
||||
saved_forms: Any = ...
|
||||
save_m2m: Any = ...
|
||||
def save(self, commit: bool = ...): ...
|
||||
def clean(self) -> None: ...
|
||||
def validate_unique(self) -> None: ...
|
||||
def get_unique_error_message(self, unique_check: Any): ...
|
||||
def get_date_error_message(self, date_check: Any): ...
|
||||
def get_form_error(self): ...
|
||||
changed_objects: Any = ...
|
||||
deleted_objects: Any = ...
|
||||
def save_existing_objects(self, commit: bool = ...): ...
|
||||
new_objects: Any = ...
|
||||
def save_new_objects(self, commit: bool = ...): ...
|
||||
def add_fields(self, form: Any, index: Any): ...
|
||||
|
||||
def modelformset_factory(
|
||||
model: Any,
|
||||
form: Any = ...,
|
||||
formfield_callback: Optional[Any] = ...,
|
||||
formset: Any = ...,
|
||||
extra: int = ...,
|
||||
can_delete: bool = ...,
|
||||
can_order: bool = ...,
|
||||
max_num: Optional[Any] = ...,
|
||||
fields: Optional[Any] = ...,
|
||||
exclude: Optional[Any] = ...,
|
||||
widgets: Optional[Any] = ...,
|
||||
validate_max: bool = ...,
|
||||
localized_fields: Optional[Any] = ...,
|
||||
labels: Optional[Any] = ...,
|
||||
help_texts: Optional[Any] = ...,
|
||||
error_messages: Optional[Any] = ...,
|
||||
min_num: Optional[Any] = ...,
|
||||
validate_min: bool = ...,
|
||||
field_classes: Optional[Any] = ...,
|
||||
): ...
|
||||
|
||||
class BaseInlineFormSet(BaseModelFormSet):
|
||||
instance: Any = ...
|
||||
save_as_new: Any = ...
|
||||
unique_fields: Any = ...
|
||||
def __init__(
|
||||
self,
|
||||
data: Optional[Any] = ...,
|
||||
files: Optional[Any] = ...,
|
||||
instance: Optional[Any] = ...,
|
||||
save_as_new: bool = ...,
|
||||
prefix: Optional[Any] = ...,
|
||||
queryset: Optional[Any] = ...,
|
||||
**kwargs: Any
|
||||
) -> None: ...
|
||||
def initial_form_count(self): ...
|
||||
@classmethod
|
||||
def get_default_prefix(cls): ...
|
||||
def save_new(self, form: Any, commit: bool = ...): ...
|
||||
def add_fields(self, form: Any, index: Any) -> None: ...
|
||||
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] = ...,
|
||||
extra: int = ...,
|
||||
can_order: bool = ...,
|
||||
can_delete: bool = ...,
|
||||
max_num: Optional[Any] = ...,
|
||||
formfield_callback: Optional[Any] = ...,
|
||||
widgets: Optional[Any] = ...,
|
||||
validate_max: bool = ...,
|
||||
localized_fields: Optional[Any] = ...,
|
||||
labels: Optional[Any] = ...,
|
||||
help_texts: Optional[Any] = ...,
|
||||
error_messages: Optional[Any] = ...,
|
||||
min_num: Optional[Any] = ...,
|
||||
validate_min: bool = ...,
|
||||
field_classes: Optional[Any] = ...,
|
||||
): ...
|
||||
|
||||
class InlineForeignKeyField(Field):
|
||||
disabled: bool
|
||||
help_text: str
|
||||
initial: Optional[Union[str, django.db.models.base.Model, int]]
|
||||
label: Optional[str]
|
||||
label_suffix: None
|
||||
localize: bool
|
||||
required: bool
|
||||
show_hidden_initial: bool
|
||||
widget: Any = ...
|
||||
default_error_messages: Any = ...
|
||||
parent_instance: django.db.models.base.Model = ...
|
||||
pk_field: bool = ...
|
||||
to_field: Optional[str] = ...
|
||||
def __init__(
|
||||
self,
|
||||
parent_instance: Model,
|
||||
*args: Any,
|
||||
pk_field: bool = ...,
|
||||
to_field: Optional[Any] = ...,
|
||||
**kwargs: Any
|
||||
) -> None: ...
|
||||
def clean(self, value: Optional[str]) -> Model: ...
|
||||
def has_changed(self, initial: int, data: str) -> bool: ...
|
||||
|
||||
class ModelChoiceIterator:
|
||||
field: django.forms.models.ModelChoiceField = ...
|
||||
queryset: Optional[django.db.models.query.QuerySet] = ...
|
||||
def __init__(self, field: Any) -> None: ...
|
||||
def __iter__(self) -> Iterator[Tuple[str, str]]: ...
|
||||
def __len__(self): ...
|
||||
def __bool__(self): ...
|
||||
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]]
|
||||
label: Optional[str]
|
||||
label_suffix: None
|
||||
localize: bool
|
||||
required: bool
|
||||
show_hidden_initial: bool
|
||||
validators: List[Any]
|
||||
widget: django.forms.widgets.Select
|
||||
default_error_messages: Any = ...
|
||||
iterator: Any = ...
|
||||
empty_label: Optional[str] = ...
|
||||
queryset: Any = ...
|
||||
limit_choices_to: None = ...
|
||||
to_field_name: None = ...
|
||||
def __init__(
|
||||
self,
|
||||
queryset: Any,
|
||||
*,
|
||||
empty_label: str = ...,
|
||||
required: bool = ...,
|
||||
widget: Optional[Any] = ...,
|
||||
label: Optional[Any] = ...,
|
||||
initial: Optional[Any] = ...,
|
||||
help_text: str = ...,
|
||||
to_field_name: Optional[Any] = ...,
|
||||
limit_choices_to: Optional[Any] = ...,
|
||||
**kwargs: Any
|
||||
) -> None: ...
|
||||
def get_limit_choices_to(self) -> Dict[Any, Any]: ...
|
||||
def __deepcopy__(
|
||||
self,
|
||||
memo: Dict[
|
||||
int,
|
||||
Union[
|
||||
OrderedDict,
|
||||
Widget,
|
||||
List[Union[Widget, Field]],
|
||||
Field,
|
||||
List[Union[AdminTextInputWidget, CharField]],
|
||||
],
|
||||
List[str],
|
||||
],
|
||||
) -> QuerySet: ...
|
||||
def clean(
|
||||
self, value: Union[List[List[str]], List[int], str, List[str]]
|
||||
) -> QuerySet: ...
|
||||
def has_changed(self, initial: List[Model], data: List[str]) -> bool: ...
|
||||
def prepare_value(self, value: Any) -> Any: ...
|
||||
def to_python(
|
||||
self,
|
||||
value: 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]: ...
|
||||
) -> 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: ...
|
||||
|
||||
class ModelMultipleChoiceField(ModelChoiceField):
|
||||
disabled: bool
|
||||
empty_label: None
|
||||
help_text: str
|
||||
initial: Optional[Union[Callable, List[int]]]
|
||||
label: Optional[str]
|
||||
label_suffix: None
|
||||
localize: bool
|
||||
required: bool
|
||||
show_hidden_initial: bool
|
||||
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 prepare_value(
|
||||
self, value: Union[Permission, List[str]]
|
||||
) -> Union[List[str], int]: ...
|
||||
def has_changed(self, initial: List[Any], data: List[str]) -> bool: ...
|
||||
|
||||
@@ -1,31 +1,30 @@
|
||||
# Stubs for django.forms.renderers (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
from typing import Any, Dict, Optional, Union
|
||||
|
||||
from typing import Any, Optional
|
||||
|
||||
from django.template.backends.django import DjangoTemplates, Template
|
||||
from typing import Any, Dict
|
||||
from django.template.backends.base import BaseEngine
|
||||
from django.template.backends.django import Template
|
||||
from django.template.backends.jinja2 import Template
|
||||
|
||||
ROOT: Any
|
||||
|
||||
def get_default_renderer() -> DjangoTemplates: ...
|
||||
|
||||
class BaseRenderer:
|
||||
def get_template(self, template_name: Any) -> None: ...
|
||||
def get_template(self, template_name: str) -> Any: ...
|
||||
def render(
|
||||
self, template_name: str, context: Dict[str, Any], request: None = ...
|
||||
) -> str: ...
|
||||
|
||||
class EngineMixin:
|
||||
def get_template(self, template_name: str) -> Template: ...
|
||||
def engine(self) -> DjangoTemplates: ...
|
||||
def get_template(self, template_name: str) -> Union[Template, Template]: ...
|
||||
def engine(self) -> BaseEngine: ...
|
||||
|
||||
class DjangoTemplates(EngineMixin, BaseRenderer):
|
||||
engine: django.template.backends.django.DjangoTemplates
|
||||
backend: Any = ...
|
||||
|
||||
class Jinja2(EngineMixin, BaseRenderer):
|
||||
engine: django.template.backends.jinja2.Jinja2
|
||||
backend: Any = ...
|
||||
|
||||
class TemplatesSetting(BaseRenderer):
|
||||
def get_template(self, template_name: Any): ...
|
||||
def get_template(self, template_name: str) -> Template: ...
|
||||
|
||||
@@ -1,42 +1,42 @@
|
||||
# Stubs for django.forms.utils (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
from collections import UserList
|
||||
from typing import Any, Optional
|
||||
|
||||
from datetime import datetime
|
||||
from typing import Any, Callable, Dict, List, Optional, Tuple, Type, Union
|
||||
|
||||
from django.core.exceptions import ValidationError
|
||||
from django.utils.safestring import SafeText
|
||||
from typing import Callable, Dict, List, Optional, Tuple, Type, Union
|
||||
|
||||
|
||||
def pretty_name(name: str) -> str: ...
|
||||
def flatatt(attrs: Dict[str, Optional[str]]) -> SafeText: ...
|
||||
def flatatt(attrs: Dict[str, Optional[Union[bool, 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) -> SafeText: ...
|
||||
def as_text(self): ...
|
||||
def __str__(self): ...
|
||||
def as_ul(self) -> str: ...
|
||||
def as_text(self) -> str: ...
|
||||
|
||||
class ErrorList(UserList, list):
|
||||
data: List[Union[str, django.core.exceptions.ValidationError]]
|
||||
error_class: str = ...
|
||||
def __init__(
|
||||
self,
|
||||
initlist: Optional[Union[ErrorList, List[str], List[ValidationError]]] = ...,
|
||||
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 as_json(self, escape_html: bool = ...): ...
|
||||
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: ...
|
||||
def __str__(self): ...
|
||||
def __repr__(self) -> str: ...
|
||||
def __contains__(self, item: str) -> bool: ...
|
||||
def __eq__(self, other: Union[ErrorList, List[str]]) -> bool: ...
|
||||
def __eq__(self, other: Union[List[str], ErrorList]) -> bool: ...
|
||||
def __getitem__(self, i: Union[str, int]) -> str: ...
|
||||
def __reduce_ex__(
|
||||
self, *args: Any, **kwargs: Any
|
||||
|
||||
@@ -1,34 +1,41 @@
|
||||
# Stubs for django.forms.widgets (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
from typing import Any, Optional
|
||||
|
||||
from collections import OrderedDict
|
||||
from datetime import date, datetime, time
|
||||
from django.core.files.uploadedfile import SimpleUploadedFile
|
||||
from itertools import chain
|
||||
from typing import Any, Callable, Dict, List, Optional, Set, Tuple, Type, Union
|
||||
|
||||
from django.contrib.admin.checks import BaseModelAdminChecks
|
||||
from django.contrib.admin.options import BaseModelAdmin
|
||||
from django.contrib.admin.widgets import (AdminBigIntegerFieldWidget,
|
||||
AdminEmailInputWidget,
|
||||
AdminFileWidget,
|
||||
AdminIntegerFieldWidget,
|
||||
AdminRadioSelect, AdminSplitDateTime,
|
||||
AdminTextareaWidget,
|
||||
AdminTextInputWidget,
|
||||
AdminURLFieldWidget,
|
||||
AutocompleteSelect,
|
||||
AutocompleteSelectMultiple,
|
||||
ForeignKeyRawIdWidget,
|
||||
RelatedFieldWidgetWrapper)
|
||||
from django.db.models.fields.files import FieldFile
|
||||
from django.forms.fields import Field
|
||||
from django.forms.forms import Form
|
||||
from django.forms.models import ModelForm
|
||||
from django.forms.renderers import DjangoTemplates
|
||||
from django.http.request import QueryDict
|
||||
from django.utils.datastructures import MultiValueDict
|
||||
from django.utils.safestring import SafeText
|
||||
from itertools import chain
|
||||
from typing import Any, Callable, Dict, Iterator, List, Optional, Set, Tuple, Type, Union
|
||||
|
||||
|
||||
class MediaOrderConflictWarning(RuntimeWarning): ...
|
||||
|
||||
class Media:
|
||||
_css: Any = ...
|
||||
_js: Any = ...
|
||||
def __init__(
|
||||
self,
|
||||
media: Optional[Type[object]] = ...,
|
||||
css: Optional[
|
||||
Union[Dict[str, Tuple[str, str]], Dict[str, List[str]], Dict[str, Tuple[str]]]
|
||||
] = ...,
|
||||
js: Any = ...,
|
||||
media: Optional[Type[Any]] = ...,
|
||||
css: Optional[Dict[str, List[str]]] = ...,
|
||||
js: Optional[List[str]] = ...,
|
||||
) -> None: ...
|
||||
def __repr__(self) -> str: ...
|
||||
def __str__(self): ...
|
||||
def render(self) -> SafeText: ...
|
||||
def render_js(self) -> List[SafeText]: ...
|
||||
def render_css(self) -> chain: ...
|
||||
@@ -36,14 +43,45 @@ class Media:
|
||||
def __getitem__(self, name: str) -> Media: ...
|
||||
@staticmethod
|
||||
def merge(
|
||||
list_1: Union[List[int], List[str], Tuple[str]], list_2: Any
|
||||
) -> Union[List[int], List[str]]: ...
|
||||
list_1: List[str],
|
||||
list_2: Union[Tuple[str, str, str, str, str], List[str]],
|
||||
) -> List[str]: ...
|
||||
def __add__(self, other: Media) -> Media: ...
|
||||
|
||||
class MediaDefiningClass(type):
|
||||
def __new__(
|
||||
mcs: Type[MediaDefiningClass], name: str, bases: Tuple, attrs: Any
|
||||
) -> Type[Any]: ...
|
||||
mcs: Type[MediaDefiningClass],
|
||||
name: str,
|
||||
bases: Tuple,
|
||||
attrs: Union[
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
str,
|
||||
Tuple,
|
||||
None,
|
||||
Type[Union[ModelForm, BaseModelAdminChecks]],
|
||||
Dict[Any, Any],
|
||||
bool,
|
||||
Callable,
|
||||
],
|
||||
],
|
||||
OrderedDict,
|
||||
Dict[str, Union[str, Callable, property]],
|
||||
],
|
||||
) -> Type[
|
||||
Union[
|
||||
ModelForm,
|
||||
AutocompleteSelect,
|
||||
BaseModelAdmin,
|
||||
Form,
|
||||
AutocompleteSelectMultiple,
|
||||
AdminFileWidget,
|
||||
AdminRadioSelect,
|
||||
RelatedFieldWidgetWrapper,
|
||||
AdminBigIntegerFieldWidget,
|
||||
]
|
||||
]: ...
|
||||
|
||||
class Widget:
|
||||
needs_multipart_form: bool = ...
|
||||
@@ -51,69 +89,75 @@ class Widget:
|
||||
is_required: bool = ...
|
||||
supports_microseconds: bool = ...
|
||||
attrs: Any = ...
|
||||
def __init__(self, attrs: Any = ...) -> None: ...
|
||||
def __init__(self, attrs: Optional[Dict[str, str]] = ...) -> None: ...
|
||||
def __deepcopy__(self, memo: Dict[int, Any]) -> Widget: ...
|
||||
@property
|
||||
def is_hidden(self): ...
|
||||
def subwidgets(self, name: Any, value: Any, attrs: Optional[Any] = ...) -> None: ...
|
||||
def format_value(self, value: Any) -> Optional[str]: ...
|
||||
def is_hidden(self) -> bool: ...
|
||||
def subwidgets(
|
||||
self, name: Any, value: Any, attrs: Optional[Any] = ...
|
||||
) -> None: ...
|
||||
def format_value(
|
||||
self, value: Optional[Union[int, str, datetime, List[str]]]
|
||||
) -> Optional[str]: ...
|
||||
def get_context(
|
||||
self, name: str, value: Any, attrs: Dict[str, Union[bool, str]]
|
||||
) -> Dict[str, Dict]: ...
|
||||
def render(
|
||||
self,
|
||||
name: str,
|
||||
value: Any,
|
||||
attrs: Optional[
|
||||
Union[Dict[str, Union[bool, str]], Dict[str, bool], Dict[str, str]]
|
||||
],
|
||||
) -> Dict[str, Dict[str, Any]]: ...
|
||||
def render(
|
||||
self,
|
||||
name: Any,
|
||||
value: Any,
|
||||
attrs: Optional[Any] = ...,
|
||||
renderer: Optional[Any] = ...,
|
||||
): ...
|
||||
def _render(
|
||||
self,
|
||||
template_name: str,
|
||||
context: Dict[str, Any],
|
||||
attrs: Dict[str, Union[bool, str]] = ...,
|
||||
renderer: Optional[DjangoTemplates] = ...,
|
||||
) -> SafeText: ...
|
||||
def build_attrs(
|
||||
self,
|
||||
base_attrs: Dict[str, Union[float, str]],
|
||||
extra_attrs: Optional[
|
||||
Union[Dict[str, Union[bool, str]], Dict[str, bool], Dict[str, str]]
|
||||
] = ...,
|
||||
) -> Dict[str, Union[float, str]]: ...
|
||||
def value_from_datadict(self, data: Any, files: Any, name: Any): ...
|
||||
def value_omitted_from_data(self, data: Any, files: Any, name: Any): ...
|
||||
def id_for_label(self, id_: Any): ...
|
||||
def use_required_attribute(self, initial: Any): ...
|
||||
base_attrs: Dict[str, Union[int, str]],
|
||||
extra_attrs: Dict[str, Union[bool, str]] = ...,
|
||||
) -> Dict[str, Union[int, str]]: ...
|
||||
def value_from_datadict(
|
||||
self,
|
||||
data: QueryDict,
|
||||
files: Union[Dict[Any, Any], MultiValueDict],
|
||||
name: str,
|
||||
) -> Optional[str]: ...
|
||||
def value_omitted_from_data(
|
||||
self, data: QueryDict, files: MultiValueDict, name: str
|
||||
) -> bool: ...
|
||||
def id_for_label(self, id_: str) -> str: ...
|
||||
def use_required_attribute(self, initial: Any) -> bool: ...
|
||||
|
||||
class Input(Widget):
|
||||
input_type: Any = ...
|
||||
attrs: Dict[Any, Any]
|
||||
input_type: str = ...
|
||||
template_name: str = ...
|
||||
def __init__(
|
||||
self, attrs: Optional[Union[Dict[str, int], Dict[str, str], Dict[str, bool]]] = ...
|
||||
) -> None: ...
|
||||
def __init__(self, attrs: Dict[str, str] = ...) -> None: ...
|
||||
def get_context(
|
||||
self,
|
||||
name: str,
|
||||
value: Any,
|
||||
attrs: Optional[
|
||||
Union[Dict[str, Union[bool, str]], Dict[str, bool], Dict[str, str]]
|
||||
self, name: str, value: Any, attrs: Dict[str, Union[bool, str]]
|
||||
) -> Dict[
|
||||
str,
|
||||
Union[
|
||||
Dict[str, Union[str, bool, FieldFile, Dict[str, str]]],
|
||||
Dict[str, Union[str, bool, None, Dict[str, str]]],
|
||||
Dict[str, Union[str, bool, None, Dict[str, Union[int, str]]]],
|
||||
Dict[str, Union[str, bool, None, Dict[str, Union[bool, str]]]],
|
||||
],
|
||||
) -> Dict[str, Dict[str, Any]]: ...
|
||||
]: ...
|
||||
|
||||
class TextInput(Input):
|
||||
attrs: Dict[str, Union[int, str]]
|
||||
is_localized: bool
|
||||
is_required: bool
|
||||
input_type: str = ...
|
||||
template_name: str = ...
|
||||
|
||||
class NumberInput(Input):
|
||||
attrs: Dict[Any, Any]
|
||||
input_type: str = ...
|
||||
template_name: str = ...
|
||||
|
||||
class EmailInput(Input):
|
||||
attrs: Dict[str, Union[bool, str]]
|
||||
is_required: bool
|
||||
input_type: str = ...
|
||||
template_name: str = ...
|
||||
|
||||
@@ -122,100 +166,101 @@ class URLInput(Input):
|
||||
template_name: str = ...
|
||||
|
||||
class PasswordInput(Input):
|
||||
attrs: Dict[str, str]
|
||||
is_required: bool
|
||||
input_type: str = ...
|
||||
template_name: str = ...
|
||||
render_value: Any = ...
|
||||
render_value: bool = ...
|
||||
def __init__(
|
||||
self, attrs: Optional[Dict[str, bool]] = ..., render_value: bool = ...
|
||||
self, attrs: Optional[Any] = ..., render_value: bool = ...
|
||||
) -> None: ...
|
||||
def get_context(
|
||||
self,
|
||||
name: str,
|
||||
value: Optional[str],
|
||||
attrs: Optional[Union[Dict[str, Union[str, bool]], Dict[str, bool]]],
|
||||
) -> Dict[str, Dict[str, Any]]: ...
|
||||
def get_context(self, name: Any, value: Any, attrs: Any): ...
|
||||
|
||||
class HiddenInput(Input):
|
||||
attrs: Dict[Any, Any]
|
||||
is_localized: bool
|
||||
input_type: str = ...
|
||||
template_name: str = ...
|
||||
|
||||
class MultipleHiddenInput(HiddenInput):
|
||||
attrs: Dict[str, str]
|
||||
choices: List[Tuple[str, str]]
|
||||
input_type: str
|
||||
is_required: bool
|
||||
template_name: str = ...
|
||||
def get_context(
|
||||
self, name: str, value: List[str], attrs: Optional[Dict[str, str]]
|
||||
) -> Dict[str, Dict[str, Any]]: ...
|
||||
def value_from_datadict(
|
||||
self, data: MultiValueDict, files: Dict[Any, Any], name: str
|
||||
) -> List[str]: ...
|
||||
def format_value(
|
||||
self, value: Union[List[int], List[str]]
|
||||
) -> Union[List[int], List[str]]: ...
|
||||
def get_context(self, name: Any, value: Any, attrs: Any): ...
|
||||
def value_from_datadict(self, data: Any, files: Any, name: Any): ...
|
||||
def format_value(self, value: Any): ...
|
||||
|
||||
class FileInput(Input):
|
||||
attrs: Dict[Any, Any]
|
||||
input_type: str = ...
|
||||
needs_multipart_form: bool = ...
|
||||
template_name: str = ...
|
||||
def format_value(self, value: None) -> None: ...
|
||||
def format_value(self, value: Any): ...
|
||||
def value_from_datadict(
|
||||
self,
|
||||
data: Union[Dict[str, str], Dict[str, bool], QueryDict],
|
||||
files: Dict[str, SimpleUploadedFile],
|
||||
name: str,
|
||||
) -> Optional[SimpleUploadedFile]: ...
|
||||
def value_omitted_from_data(
|
||||
self,
|
||||
data: Dict[Any, Any],
|
||||
files: Dict[str, Union[SimpleUploadedFile, str]],
|
||||
name: str,
|
||||
) -> bool: ...
|
||||
self, data: QueryDict, files: Dict[Any, Any], name: str
|
||||
) -> None: ...
|
||||
def value_omitted_from_data(self, data: Any, files: Any, name: Any): ...
|
||||
|
||||
class ClearableFileInput(FileInput):
|
||||
attrs: Dict[Any, Any]
|
||||
clear_checkbox_label: Any = ...
|
||||
initial_text: Any = ...
|
||||
input_text: Any = ...
|
||||
template_name: str = ...
|
||||
def clear_checkbox_name(self, name: str) -> str: ...
|
||||
def clear_checkbox_id(self, name: str) -> str: ...
|
||||
def is_initial(self, value: object) -> bool: ...
|
||||
def is_initial(self, value: Optional[FieldFile]) -> bool: ...
|
||||
def format_value(
|
||||
self, value: Optional[Union[str, FieldFile]]
|
||||
self, value: Optional[FieldFile]
|
||||
) -> Optional[FieldFile]: ...
|
||||
def get_context(self, name: Any, value: Any, attrs: Any): ...
|
||||
def value_from_datadict(
|
||||
self,
|
||||
data: Union[Dict[str, bool], Dict[str, None], Dict[str, str], QueryDict],
|
||||
files: Dict[str, Union[SimpleUploadedFile, str]],
|
||||
name: str,
|
||||
) -> Optional[Union[str, SimpleUploadedFile]]: ...
|
||||
self, data: QueryDict, files: Dict[Any, Any], name: str
|
||||
) -> None: ...
|
||||
def use_required_attribute(self, initial: Optional[FieldFile]) -> 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: Any, files: Any, name: Any): ...
|
||||
|
||||
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[Any] = ...) -> None: ...
|
||||
|
||||
class DateTimeBaseInput(TextInput):
|
||||
format_key: str = ...
|
||||
supports_microseconds: bool = ...
|
||||
format: Any = ...
|
||||
def __init__(
|
||||
self, attrs: Optional[Dict[str, str]] = ..., format: Optional[str] = ...
|
||||
self, attrs: Optional[Any] = ..., format: Optional[Any] = ...
|
||||
) -> None: ...
|
||||
def format_value(self, value: Optional[Union[time, str, date]]) -> Optional[str]: ...
|
||||
def format_value(self, value: Union[date, time, str]) -> str: ...
|
||||
|
||||
class DateInput(DateTimeBaseInput):
|
||||
attrs: Dict[str, str]
|
||||
format: Optional[str]
|
||||
input_type: str
|
||||
is_localized: bool
|
||||
is_required: bool
|
||||
format_key: str = ...
|
||||
template_name: str = ...
|
||||
|
||||
class DateTimeInput(DateTimeBaseInput):
|
||||
attrs: Dict[Any, Any]
|
||||
format: Optional[str]
|
||||
input_type: str
|
||||
is_localized: bool
|
||||
is_required: bool
|
||||
format_key: str = ...
|
||||
template_name: str = ...
|
||||
|
||||
class TimeInput(DateTimeBaseInput):
|
||||
attrs: Dict[str, str]
|
||||
format: Optional[str]
|
||||
input_type: str
|
||||
is_localized: bool
|
||||
is_required: bool
|
||||
format_key: str = ...
|
||||
template_name: str = ...
|
||||
|
||||
@@ -224,33 +269,23 @@ class CheckboxInput(Input):
|
||||
template_name: str = ...
|
||||
check_test: Any = ...
|
||||
def __init__(
|
||||
self, attrs: Optional[Dict[str, str]] = ..., check_test: Optional[Callable] = ...
|
||||
self, attrs: Dict[str, str] = ..., check_test: Callable = ...
|
||||
) -> None: ...
|
||||
def format_value(self, value: Optional[Union[str, int]]) -> Optional[str]: ...
|
||||
def format_value(self, value: None) -> None: ...
|
||||
def get_context(
|
||||
self,
|
||||
name: str,
|
||||
value: Optional[Union[int, str]],
|
||||
attrs: Optional[
|
||||
Union[Dict[str, Union[bool, str]], Dict[str, bool], Dict[str, str]]
|
||||
self, name: str, value: Optional[bool], attrs: Dict[str, str]
|
||||
) -> Dict[
|
||||
str,
|
||||
Union[
|
||||
Dict[str, Union[str, bool, None, Dict[str, str]]],
|
||||
Dict[str, Union[str, bool, None, Dict[str, Union[bool, str]]]],
|
||||
],
|
||||
) -> Dict[str, Dict[str, Any]]: ...
|
||||
]: ...
|
||||
def value_from_datadict(
|
||||
self,
|
||||
data: Any,
|
||||
files: Union[MultiValueDict, Dict[str, SimpleUploadedFile]],
|
||||
name: str,
|
||||
self, data: QueryDict, files: MultiValueDict, name: str
|
||||
) -> bool: ...
|
||||
def value_omitted_from_data(
|
||||
self,
|
||||
data: Union[
|
||||
Dict[str, Union[str, List[int]]],
|
||||
Dict[str, str],
|
||||
Dict[str, Union[int, str, None, datetime]],
|
||||
QueryDict,
|
||||
],
|
||||
files: MultiValueDict,
|
||||
name: str,
|
||||
self, data: QueryDict, files: MultiValueDict, name: str
|
||||
) -> bool: ...
|
||||
|
||||
class ChoiceWidget(Widget):
|
||||
@@ -262,56 +297,63 @@ class ChoiceWidget(Widget):
|
||||
checked_attribute: Any = ...
|
||||
option_inherits_attrs: bool = ...
|
||||
choices: Any = ...
|
||||
def __init__(
|
||||
self,
|
||||
attrs: Optional[Union[Dict[str, Union[bool, str]], Dict[str, str]]] = ...,
|
||||
choices: Any = ...,
|
||||
) -> None: ...
|
||||
def __deepcopy__(self, memo: Dict[int, Any]) -> ChoiceWidget: ...
|
||||
def __init__(self, attrs: None = ..., choices: Tuple = ...) -> None: ...
|
||||
def __deepcopy__(self, memo: Dict[int, Any]) -> Select: ...
|
||||
def subwidgets(
|
||||
self,
|
||||
name: str,
|
||||
value: Optional[List[str]],
|
||||
attrs: Dict[str, Union[bool, str]] = ...,
|
||||
self, name: Any, value: Any, attrs: Optional[Any] = ...
|
||||
) -> None: ...
|
||||
def options(
|
||||
self, name: str, value: List[str], attrs: Dict[str, Union[bool, str]] = ...
|
||||
self, name: Any, value: Any, attrs: Optional[Any] = ...
|
||||
) -> None: ...
|
||||
def optgroups(
|
||||
self,
|
||||
name: str,
|
||||
value: List[str],
|
||||
attrs: Optional[
|
||||
Union[Dict[str, Union[bool, str]], Dict[str, bool], Dict[str, str]]
|
||||
] = ...,
|
||||
) -> Any: ...
|
||||
attrs: Dict[str, Union[bool, str]] = ...,
|
||||
) -> Union[
|
||||
List[
|
||||
Tuple[None, List[Dict[str, Union[str, int, Dict[Any, Any]]]], int]
|
||||
],
|
||||
List[Tuple[None, int, int]],
|
||||
]: ...
|
||||
def create_option(
|
||||
self,
|
||||
name: str,
|
||||
value: Union[str, time, int],
|
||||
label: Union[str, int],
|
||||
value: Union[str, int],
|
||||
label: str,
|
||||
selected: Union[bool, Set[str]],
|
||||
index: int,
|
||||
subindex: Optional[int] = ...,
|
||||
attrs: Optional[
|
||||
Union[Dict[str, Union[bool, str]], Dict[str, bool], Dict[str, str]]
|
||||
] = ...,
|
||||
) -> Dict[str, Any]: ...
|
||||
subindex: None = ...,
|
||||
attrs: Optional[Union[Dict[str, bool], Dict[str, str]]] = ...,
|
||||
) -> Dict[
|
||||
str, Union[str, int, Dict[Any, Any], Set[str], Dict[str, bool]]
|
||||
]: ...
|
||||
def get_context(
|
||||
self,
|
||||
name: str,
|
||||
value: Any,
|
||||
attrs: Optional[
|
||||
Union[Dict[str, Union[bool, str]], Dict[str, bool], Dict[str, str]]
|
||||
],
|
||||
) -> Dict[str, Dict[str, Any]]: ...
|
||||
value: Optional[Union[str, int, List[Any]]],
|
||||
attrs: Dict[str, Union[bool, str]],
|
||||
) -> Dict[str, Dict]: ...
|
||||
def id_for_label(self, id_: str, index: str = ...) -> str: ...
|
||||
def value_from_datadict(
|
||||
self, data: dict, files: MultiValueDict, name: str
|
||||
) -> Optional[Union[str, List[str], int]]: ...
|
||||
def format_value(self, value: Any) -> List[str]: ...
|
||||
self,
|
||||
data: QueryDict,
|
||||
files: Union[Dict[Any, Any], MultiValueDict],
|
||||
name: str,
|
||||
) -> str: ...
|
||||
def format_value(
|
||||
self, value: Optional[Union[str, int, List[Any]]]
|
||||
) -> List[str]: ...
|
||||
|
||||
class Select(ChoiceWidget):
|
||||
attrs: Dict[str, str]
|
||||
choices: Union[
|
||||
List[Union[Tuple[str, str], Tuple[int, int]]],
|
||||
List[List[str]],
|
||||
List[Tuple[int, str]],
|
||||
List[Tuple[str, Union[str, Tuple[Tuple[str, str], Tuple[str, str]]]]],
|
||||
]
|
||||
is_required: bool
|
||||
input_type: str = ...
|
||||
template_name: str = ...
|
||||
option_template_name: str = ...
|
||||
@@ -321,94 +363,132 @@ class Select(ChoiceWidget):
|
||||
def get_context(
|
||||
self,
|
||||
name: str,
|
||||
value: Any,
|
||||
attrs: Optional[
|
||||
Union[Dict[str, Union[str, bool]], Dict[str, bool], Dict[str, str]]
|
||||
],
|
||||
) -> Dict[str, Dict[str, Any]]: ...
|
||||
@staticmethod
|
||||
def _choice_has_empty_value(
|
||||
choice: Union[Tuple[None, str], Tuple[str, str]]
|
||||
) -> bool: ...
|
||||
def use_required_attribute(self, initial: Any) -> bool: ...
|
||||
value: Optional[Union[str, int, List[Any]]],
|
||||
attrs: Dict[str, Union[bool, str]],
|
||||
) -> Dict[str, Dict]: ...
|
||||
def use_required_attribute(self, initial: Optional[str]) -> bool: ...
|
||||
|
||||
class NullBooleanSelect(Select):
|
||||
def __init__(self, attrs: None = ...) -> None: ...
|
||||
def format_value(self, value: Optional[str]) -> str: ...
|
||||
def __init__(self, attrs: Optional[Any] = ...) -> None: ...
|
||||
def format_value(self, value: Any): ...
|
||||
def value_from_datadict(
|
||||
self, data: Dict[str, Union[str, bool]], files: Dict[Any, Any], name: str
|
||||
) -> Optional[bool]: ...
|
||||
self, data: QueryDict, files: MultiValueDict, name: str
|
||||
) -> None: ...
|
||||
|
||||
class SelectMultiple(Select):
|
||||
attrs: Dict[Any, Any]
|
||||
choices: List[
|
||||
Tuple[str, Union[str, Tuple[Tuple[str, str], Tuple[str, str]]]]
|
||||
]
|
||||
is_required: bool
|
||||
allow_multiple_selected: bool = ...
|
||||
def value_from_datadict(
|
||||
self, data: Any, files: MultiValueDict, name: str
|
||||
) -> Optional[Union[List[int], str, List[str]]]: ...
|
||||
def value_omitted_from_data(
|
||||
self, data: Dict[Any, Any], files: Dict[Any, Any], name: str
|
||||
) -> bool: ...
|
||||
self, data: QueryDict, files: MultiValueDict, name: str
|
||||
) -> List[str]: ...
|
||||
def value_omitted_from_data(self, data: Any, files: Any, name: Any): ...
|
||||
|
||||
class RadioSelect(ChoiceWidget):
|
||||
attrs: Dict[Any, Any]
|
||||
choices: List[int]
|
||||
input_type: str = ...
|
||||
template_name: str = ...
|
||||
option_template_name: str = ...
|
||||
|
||||
class CheckboxSelectMultiple(ChoiceWidget):
|
||||
attrs: Dict[Any, Any]
|
||||
choices: Union[
|
||||
List[Tuple[str, Union[str, Tuple[Tuple[str, str], Tuple[str, str]]]]],
|
||||
List[Tuple[datetime.time, str]],
|
||||
List[Tuple[int, str]],
|
||||
]
|
||||
is_required: bool
|
||||
allow_multiple_selected: bool = ...
|
||||
input_type: str = ...
|
||||
template_name: str = ...
|
||||
option_template_name: str = ...
|
||||
def use_required_attribute(self, initial: None) -> bool: ...
|
||||
def value_omitted_from_data(
|
||||
self, data: Dict[Any, Any], files: Dict[Any, Any], name: str
|
||||
) -> bool: ...
|
||||
def id_for_label(self, id_: str, index: Optional[str] = ...) -> str: ...
|
||||
def use_required_attribute(self, initial: Any): ...
|
||||
def value_omitted_from_data(self, data: Any, files: Any, name: Any): ...
|
||||
def id_for_label(self, id_: Any, index: Optional[Any] = ...): ...
|
||||
|
||||
class MultiWidget(Widget):
|
||||
attrs: Dict[Any, Any]
|
||||
template_name: str = ...
|
||||
widgets: Any = ...
|
||||
def __init__(self, widgets: Any, attrs: Optional[Dict[str, str]] = ...) -> None: ...
|
||||
widgets: List[django.forms.widgets.ClearableFileInput] = ...
|
||||
def __init__(
|
||||
self, widgets: Tuple[DateInput, TimeInput], attrs: None = ...
|
||||
) -> None: ...
|
||||
@property
|
||||
def is_hidden(self) -> bool: ...
|
||||
def get_context(
|
||||
self,
|
||||
name: str,
|
||||
value: Optional[Union[str, datetime, List[str]]],
|
||||
attrs: Optional[Union[Dict[str, Union[str, bool]], Dict[str, str]]],
|
||||
) -> Dict[str, Dict[str, Any]]: ...
|
||||
value: Union[List[str], datetime],
|
||||
attrs: Dict[str, Union[bool, str]],
|
||||
) -> Dict[
|
||||
str,
|
||||
Union[
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
str,
|
||||
bool,
|
||||
Dict[str, Union[bool, str]],
|
||||
List[
|
||||
Dict[str, Union[str, bool, Dict[str, Union[bool, str]]]]
|
||||
],
|
||||
],
|
||||
],
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
str,
|
||||
bool,
|
||||
Dict[str, str],
|
||||
List[Dict[str, Union[str, bool, Dict[str, str]]]],
|
||||
],
|
||||
],
|
||||
],
|
||||
]: ...
|
||||
def id_for_label(self, id_: str) -> str: ...
|
||||
def value_from_datadict(
|
||||
self,
|
||||
data: Union[Dict[str, str], Dict[str, Union[str, List[str]]], QueryDict],
|
||||
files: MultiValueDict,
|
||||
data: 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: MultiValueDict, name: str
|
||||
self, data: QueryDict, files: MultiValueDict, name: str
|
||||
) -> bool: ...
|
||||
def decompress(self, value: Any) -> None: ...
|
||||
def _get_media(self) -> Media: ...
|
||||
media: Any = ...
|
||||
def __deepcopy__(self, memo: Dict[int, Any]) -> MultiWidget: ...
|
||||
def __deepcopy__(
|
||||
self,
|
||||
memo: Union[
|
||||
int, OrderedDict, Widget, List[Union[Widget, Field]], Field
|
||||
],
|
||||
) -> AdminSplitDateTime: ...
|
||||
@property
|
||||
def needs_multipart_form(self) -> bool: ...
|
||||
def needs_multipart_form(self): ...
|
||||
|
||||
class SplitDateTimeWidget(MultiWidget):
|
||||
attrs: Dict[Any, Any]
|
||||
widgets: List[django.forms.widgets.DateTimeBaseInput]
|
||||
supports_microseconds: bool = ...
|
||||
template_name: str = ...
|
||||
def __init__(
|
||||
self,
|
||||
attrs: Optional[Dict[str, str]] = ...,
|
||||
attrs: None = ...,
|
||||
date_format: None = ...,
|
||||
time_format: None = ...,
|
||||
date_attrs: Optional[Dict[str, str]] = ...,
|
||||
time_attrs: Optional[Dict[str, str]] = ...,
|
||||
date_attrs: None = ...,
|
||||
time_attrs: None = ...,
|
||||
) -> None: ...
|
||||
def decompress(
|
||||
self, value: Optional[datetime]
|
||||
) -> Union[List[Union[date, time]], List[None]]: ...
|
||||
def decompress(self, value: datetime) -> List[Union[date, time]]: ...
|
||||
|
||||
class SplitHiddenDateTimeWidget(SplitDateTimeWidget):
|
||||
attrs: Dict[Any, Any]
|
||||
is_required: bool
|
||||
widgets: List[django.forms.widgets.DateTimeBaseInput]
|
||||
template_name: str = ...
|
||||
def __init__(
|
||||
self,
|
||||
@@ -436,21 +516,13 @@ class SelectDateWidget(Widget):
|
||||
day_none_value: Any = ...
|
||||
def __init__(
|
||||
self,
|
||||
attrs: None = ...,
|
||||
years: Optional[Union[range, Tuple[str]]] = ...,
|
||||
months: None = ...,
|
||||
empty_label: Optional[Tuple[str, str, str]] = ...,
|
||||
attrs: Optional[Any] = ...,
|
||||
years: Optional[Any] = ...,
|
||||
months: Optional[Any] = ...,
|
||||
empty_label: Optional[Any] = ...,
|
||||
) -> None: ...
|
||||
def get_context(self, name: Any, value: Any, attrs: Any): ...
|
||||
def format_value(
|
||||
self, value: Optional[Union[str, date]]
|
||||
) -> Dict[str, Optional[Union[str, int]]]: ...
|
||||
@staticmethod
|
||||
def _parse_date_fmt() -> Iterator[str]: ...
|
||||
def format_value(self, value: Any): ...
|
||||
def id_for_label(self, id_: Any): ...
|
||||
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: Any, files: Any, name: Any): ...
|
||||
def value_omitted_from_data(self, data: Any, files: Any, name: Any): ...
|
||||
|
||||
Reference in New Issue
Block a user