mirror of
https://github.com/davidhalter/django-stubs.git
synced 2026-05-19 23:09:56 +08:00
move most of the generated files
This commit is contained in:
@@ -0,0 +1,61 @@
|
||||
from typing import Any, Dict, List, Optional, Union
|
||||
|
||||
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:
|
||||
initial: Any
|
||||
form: BaseForm = ...
|
||||
field: 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) -> bool: ...
|
||||
def __iter__(self): ...
|
||||
def __len__(self) -> int: ...
|
||||
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_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: ...
|
||||
@property
|
||||
def data(self) -> Any: ...
|
||||
def value(self) -> Any: ...
|
||||
def label_tag(
|
||||
self, contents: Optional[str] = ..., attrs: Optional[Dict[str, str]] = ..., label_suffix: Optional[str] = ...
|
||||
) -> SafeText: ...
|
||||
def css_classes(self, extra_classes: None = ...) -> str: ...
|
||||
@property
|
||||
def is_hidden(self) -> bool: ...
|
||||
@property
|
||||
def auto_id(self) -> str: ...
|
||||
@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]]: ...
|
||||
|
||||
class BoundWidget:
|
||||
parent_widget: Widget = ...
|
||||
data: Dict[str, Any] = ...
|
||||
renderer: DjangoTemplates = ...
|
||||
def __init__(self, parent_widget: Widget, data: Dict[str, Any], renderer: DjangoTemplates) -> None: ...
|
||||
def tag(self, wrap_label: bool = ...) -> SafeText: ...
|
||||
@property
|
||||
def template_name(self) -> str: ...
|
||||
@property
|
||||
def id_for_label(self) -> str: ...
|
||||
@property
|
||||
def choice_label(self) -> str: ...
|
||||
@@ -0,0 +1,534 @@
|
||||
from collections import OrderedDict
|
||||
from datetime import date, datetime, time, timedelta
|
||||
from decimal import Decimal
|
||||
from typing import Any, Callable, Dict, List, Optional, Tuple, Union, Type
|
||||
from uuid import UUID
|
||||
|
||||
from django.core.files.base import File
|
||||
from django.core.files.uploadedfile import SimpleUploadedFile
|
||||
from django.core.validators import BaseValidator
|
||||
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 Input, Widget
|
||||
|
||||
class Field:
|
||||
initial: None
|
||||
label: None
|
||||
required: bool
|
||||
widget: Input = ...
|
||||
hidden_widget: Any = ...
|
||||
default_validators: Any = ...
|
||||
default_error_messages: Any = ...
|
||||
empty_values: Any = ...
|
||||
show_hidden_initial: bool = ...
|
||||
help_text: str = ...
|
||||
disabled: bool = ...
|
||||
label_suffix: None = ...
|
||||
localize: bool = ...
|
||||
error_messages: Any = ...
|
||||
validators: List[BaseValidator] = ...
|
||||
def __init__(
|
||||
self,
|
||||
*,
|
||||
required: bool = ...,
|
||||
widget: Optional[Any] = ...,
|
||||
label: Optional[Any] = ...,
|
||||
initial: Optional[Any] = ...,
|
||||
help_text: str = ...,
|
||||
error_messages: Optional[Any] = ...,
|
||||
show_hidden_initial: bool = ...,
|
||||
validators: Any = ...,
|
||||
localize: bool = ...,
|
||||
disabled: bool = ...,
|
||||
label_suffix: Optional[Any] = ...
|
||||
) -> None: ...
|
||||
def prepare_value(self, value: Any) -> Any: ...
|
||||
def to_python(
|
||||
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 __deepcopy__(
|
||||
self, memo: Dict[int, Union[List[Tuple[Union[int, str], str]], List[Widget], OrderedDict, Field, Widget]]
|
||||
) -> Field: ...
|
||||
|
||||
class CharField(Field):
|
||||
disabled: bool
|
||||
error_messages: Dict[str, str]
|
||||
help_text: str
|
||||
initial: Optional[Union[Callable, str]]
|
||||
label: Optional[str]
|
||||
label_suffix: Optional[str]
|
||||
localize: bool
|
||||
required: bool
|
||||
show_hidden_initial: bool
|
||||
max_length: Optional[Union[int, str]] = ...
|
||||
min_length: Optional[Union[int, str]] = ...
|
||||
strip: bool = ...
|
||||
empty_value: Optional[str] = ...
|
||||
def __init__(
|
||||
self,
|
||||
*,
|
||||
max_length: Optional[Any] = ...,
|
||||
min_length: Optional[Any] = ...,
|
||||
strip: bool = ...,
|
||||
empty_value: str = ...,
|
||||
**kwargs: Any
|
||||
) -> None: ...
|
||||
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):
|
||||
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
|
||||
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]]: ...
|
||||
|
||||
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
|
||||
default_error_messages: Any = ...
|
||||
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]]: ...
|
||||
|
||||
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
|
||||
default_error_messages: Any = ...
|
||||
def __init__(
|
||||
self,
|
||||
*,
|
||||
max_value: Optional[Any] = ...,
|
||||
min_value: Optional[Any] = ...,
|
||||
max_digits: Optional[Any] = ...,
|
||||
decimal_places: Optional[Any] = ...,
|
||||
**kwargs: Any
|
||||
) -> None: ...
|
||||
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]]: ...
|
||||
|
||||
class BaseTemporalField(Field):
|
||||
input_formats: Any = ...
|
||||
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: ...
|
||||
|
||||
class DateField(BaseTemporalField):
|
||||
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
|
||||
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: ...
|
||||
|
||||
class TimeField(BaseTemporalField):
|
||||
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
|
||||
input_formats: Any = ...
|
||||
default_error_messages: Any = ...
|
||||
def to_python(self, value: Optional[Union[time, str]]) -> Optional[time]: ...
|
||||
def strptime(self, value: str, format: str) -> time: ...
|
||||
|
||||
class DateTimeField(BaseTemporalField):
|
||||
disabled: bool
|
||||
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
|
||||
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 strptime(self, value: str, format: str) -> datetime: ...
|
||||
|
||||
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[Union[timedelta, str]]) -> Optional[str]: ...
|
||||
def to_python(self, value: Union[int, str]) -> timedelta: ...
|
||||
|
||||
class RegexField(CharField):
|
||||
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
|
||||
def __init__(self, regex: str, **kwargs: Any) -> None: ...
|
||||
regex: Any = ...
|
||||
|
||||
class EmailField(CharField):
|
||||
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
|
||||
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
|
||||
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: ...
|
||||
|
||||
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: Optional[SimpleUploadedFile]) -> Optional[SimpleUploadedFile]: ...
|
||||
def widget_attrs(self, widget: Widget) -> Dict[str, str]: ...
|
||||
|
||||
class URLField(CharField):
|
||||
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
|
||||
default_error_messages: Any = ...
|
||||
default_validators: Any = ...
|
||||
def __init__(self, **kwargs: Any) -> None: ...
|
||||
def to_python(self, value: Optional[Union[int, str]]) -> Optional[str]: ...
|
||||
|
||||
class BooleanField(Field):
|
||||
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
|
||||
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: ...
|
||||
|
||||
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
|
||||
def to_python(self, value: Optional[Union[bool, str]]) -> Optional[bool]: ...
|
||||
def validate(self, value: Optional[bool]) -> None: ...
|
||||
|
||||
class CallableChoiceIterator:
|
||||
choices_func: Callable = ...
|
||||
def __init__(self, choices_func: Callable) -> None: ...
|
||||
def __iter__(self) -> None: ...
|
||||
|
||||
class ChoiceField(Field):
|
||||
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
|
||||
default_error_messages: Any = ...
|
||||
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]]
|
||||
) -> ChoiceField: ...
|
||||
def to_python(self, value: Optional[Union[int, str]]) -> str: ...
|
||||
def validate(self, value: str) -> None: ...
|
||||
def valid_value(self, value: str) -> bool: ...
|
||||
|
||||
class TypedChoiceField(ChoiceField):
|
||||
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[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]]: ...
|
||||
|
||||
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
|
||||
hidden_widget: Any = ...
|
||||
default_error_messages: Any = ...
|
||||
def to_python(self, value: Optional[Union[List[Union[int, str]], Tuple, str]]) -> List[str]: ...
|
||||
def validate(self, value: List[str]) -> None: ...
|
||||
def has_changed(
|
||||
self, initial: Optional[Union[List[int], List[str], str]], data: Optional[Union[List[str], str]]
|
||||
) -> bool: ...
|
||||
|
||||
class TypedMultipleChoiceField(MultipleChoiceField):
|
||||
disabled: bool
|
||||
help_text: str
|
||||
initial: None
|
||||
label: None
|
||||
label_suffix: None
|
||||
localize: bool
|
||||
required: bool
|
||||
show_hidden_initial: bool
|
||||
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 validate(self, value: List[str]) -> 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: 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 validate(self, value: Union[datetime, str]) -> None: ...
|
||||
def clean(
|
||||
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]]
|
||||
) -> 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,
|
||||
*,
|
||||
match: Optional[Any] = ...,
|
||||
recursive: bool = ...,
|
||||
allow_files: bool = ...,
|
||||
allow_folders: bool = ...,
|
||||
**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
|
||||
hidden_widget: Any = ...
|
||||
default_error_messages: Any = ...
|
||||
def __init__(
|
||||
self, *, input_date_formats: Optional[Any] = ..., input_time_formats: Optional[Any] = ..., **kwargs: Any
|
||||
) -> None: ...
|
||||
def compress(self, data_list: List[Optional[datetime]]) -> Optional[datetime]: ...
|
||||
|
||||
class GenericIPAddressField(CharField):
|
||||
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
|
||||
unpack_ipv4: bool = ...
|
||||
default_validators: List[Callable] = ...
|
||||
def __init__(self, *, protocol: str = ..., unpack_ipv4: bool = ..., **kwargs: Any) -> None: ...
|
||||
def to_python(self, value: Optional[str]) -> str: ...
|
||||
|
||||
class SlugField(CharField):
|
||||
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
|
||||
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: UUID) -> str: ...
|
||||
def to_python(self, value: str) -> Optional[UUID]: ...
|
||||
@@ -0,0 +1,78 @@
|
||||
from collections import OrderedDict
|
||||
from datetime import date, datetime
|
||||
from typing import Any, Dict, Iterator, List, Optional, Tuple, Type, Union
|
||||
|
||||
from django.core.exceptions import ValidationError
|
||||
from django.core.files.uploadedfile import SimpleUploadedFile
|
||||
from django.db.models.query import QuerySet
|
||||
from django.forms.boundfield import BoundField
|
||||
from django.forms.fields import Field
|
||||
from django.forms.utils import ErrorDict, ErrorList
|
||||
from django.forms.widgets import Media, MediaDefiningClass
|
||||
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
|
||||
) -> Type[BaseForm]: ...
|
||||
@classmethod
|
||||
def __prepare__(metacls: Any, name: str, bases: Tuple[Type[BaseForm]], **kwds: Any) -> OrderedDict: ...
|
||||
|
||||
class BaseForm:
|
||||
default_renderer: Any = ...
|
||||
field_order: Any = ...
|
||||
prefix: Any = ...
|
||||
use_required_attribute: bool = ...
|
||||
is_bound: Any = ...
|
||||
data: Any = ...
|
||||
files: Any = ...
|
||||
auto_id: Any = ...
|
||||
initial: Any = ...
|
||||
error_class: Any = ...
|
||||
label_suffix: Any = ...
|
||||
empty_permitted: Any = ...
|
||||
fields: Any = ...
|
||||
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]] = ...,
|
||||
auto_id: Optional[Union[bool, str]] = ...,
|
||||
prefix: Optional[str] = ...,
|
||||
initial: Optional[Union[Dict[str, List[int]], Dict[str, date], Dict[str, str]]] = ...,
|
||||
error_class: Type[ErrorList] = ...,
|
||||
label_suffix: None = ...,
|
||||
empty_permitted: bool = ...,
|
||||
field_order: None = ...,
|
||||
use_required_attribute: Optional[bool] = ...,
|
||||
renderer: Any = ...,
|
||||
) -> None: ...
|
||||
def order_fields(self, field_order: Optional[List[str]]) -> None: ...
|
||||
def __iter__(self) -> Iterator[BoundField]: ...
|
||||
def __getitem__(self, name: str) -> BoundField: ...
|
||||
@property
|
||||
def errors(self) -> ErrorDict: ...
|
||||
def is_valid(self) -> bool: ...
|
||||
def add_prefix(self, field_name: str) -> str: ...
|
||||
def add_initial_prefix(self, field_name: str) -> str: ...
|
||||
def as_table(self) -> SafeText: ...
|
||||
def as_ul(self) -> SafeText: ...
|
||||
def as_p(self) -> SafeText: ...
|
||||
def non_field_errors(self) -> ErrorList: ...
|
||||
def add_error(self, field: Optional[str], error: Union[ValidationError, str]) -> None: ...
|
||||
def has_error(self, field: Any, code: Optional[Any] = ...): ...
|
||||
cleaned_data: Any = ...
|
||||
def full_clean(self) -> None: ...
|
||||
def clean(self) -> Dict[str, Optional[Union[datetime, SimpleUploadedFile, QuerySet, str]]]: ...
|
||||
def has_changed(self) -> bool: ...
|
||||
def changed_data(self) -> List[str]: ...
|
||||
@property
|
||||
def media(self) -> Media: ...
|
||||
def is_multipart(self): ...
|
||||
def hidden_fields(self): ...
|
||||
def visible_fields(self): ...
|
||||
def get_initial_for_field(self, field: Field, field_name: str) -> Any: ...
|
||||
|
||||
class Form(BaseForm): ...
|
||||
@@ -0,0 +1,94 @@
|
||||
import collections
|
||||
from typing import Any, List, Optional, Union, Dict, Type
|
||||
|
||||
from django.forms.renderers import BaseRenderer
|
||||
from django.forms.utils import ErrorList
|
||||
|
||||
from django.forms import Form
|
||||
|
||||
class ManagementForm(Form):
|
||||
auto_id: Union[bool, str]
|
||||
cleaned_data: Dict[str, Optional[int]]
|
||||
data: Dict[str, Union[List[int], int, str]]
|
||||
empty_permitted: bool
|
||||
error_class: Type[ErrorList]
|
||||
fields: collections.OrderedDict
|
||||
files: Dict[Any, Any]
|
||||
initial: Dict[str, int]
|
||||
is_bound: bool
|
||||
label_suffix: str
|
||||
prefix: str
|
||||
renderer: BaseRenderer
|
||||
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: ...
|
||||
@@ -0,0 +1,300 @@
|
||||
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 unittest.mock import MagicMock
|
||||
from uuid import UUID
|
||||
|
||||
from django.core.files.uploadedfile import SimpleUploadedFile
|
||||
from django.db.models.base import Model
|
||||
from django.db.models.manager import Manager
|
||||
from django.db.models.query import QuerySet
|
||||
from django.db.models.query_utils import Q
|
||||
from django.forms.fields import CharField, ChoiceField, Field
|
||||
from django.forms.forms import BaseForm, DeclarativeFieldsMetaclass
|
||||
from django.forms.formsets import BaseFormSet
|
||||
from django.forms.utils import ErrorList
|
||||
from django.forms.widgets import Input, Widget
|
||||
from django.http.request import QueryDict
|
||||
from django.utils.datastructures import MultiValueDict
|
||||
|
||||
ALL_FIELDS: str
|
||||
|
||||
def model_to_dict(
|
||||
instance: Model,
|
||||
fields: Optional[Union[List[Union[Callable, str]], Tuple[str]]] = ...,
|
||||
exclude: Optional[Union[List[Union[Callable, str]], Tuple[str]]] = ...,
|
||||
) -> Dict[str, Optional[Union[bool, date, float]]]: ...
|
||||
def fields_for_model(
|
||||
model: Type[Model],
|
||||
fields: Optional[Union[List[Union[Callable, str]], Tuple]] = ...,
|
||||
exclude: Optional[Union[List[Union[Callable, str]], Tuple]] = ...,
|
||||
widgets: Optional[Union[Dict[str, Type[Input]], Dict[str, Widget]]] = ...,
|
||||
formfield_callback: Optional[Union[Callable, str]] = ...,
|
||||
localized_fields: Optional[Union[Tuple[str], str]] = ...,
|
||||
labels: Optional[Dict[str, str]] = ...,
|
||||
help_texts: Optional[Dict[str, str]] = ...,
|
||||
error_messages: Optional[Dict[str, Dict[str, str]]] = ...,
|
||||
field_classes: Optional[Dict[str, Type[CharField]]] = ...,
|
||||
*,
|
||||
apply_limit_choices_to: bool = ...
|
||||
) -> OrderedDict: ...
|
||||
|
||||
class ModelFormOptions:
|
||||
model: Optional[Type[Model]] = ...
|
||||
fields: Optional[Union[List[Union[Callable, str]], Tuple, str]] = ...
|
||||
exclude: Optional[Union[List[Union[Callable, str]], Tuple, str]] = ...
|
||||
widgets: Optional[Dict[str, Union[Widget, Input]]] = ...
|
||||
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[Field]]] = ...
|
||||
def __init__(self, options: Optional[type] = ...) -> None: ...
|
||||
|
||||
class ModelFormMetaclass(DeclarativeFieldsMetaclass):
|
||||
def __new__(
|
||||
mcs: Type[ModelFormMetaclass], name: str, bases: Tuple[Type[ModelForm]], attrs: OrderedDict
|
||||
) -> Type[ModelForm]: ...
|
||||
|
||||
class BaseModelForm(BaseForm):
|
||||
instance: Any = ...
|
||||
def __init__(
|
||||
self,
|
||||
data: Optional[
|
||||
Union[
|
||||
Dict[str, Optional[Union[List[int], datetime, int, str]]],
|
||||
Dict[str, Union[List[str], str]],
|
||||
Dict[str, Union[datetime, Decimal, int, str]],
|
||||
QueryDict,
|
||||
]
|
||||
] = ...,
|
||||
files: Optional[Union[Dict[str, SimpleUploadedFile], MultiValueDict]] = ...,
|
||||
auto_id: Union[bool, str] = ...,
|
||||
prefix: None = ...,
|
||||
initial: Optional[Union[Dict[str, List[int]], Dict[str, int]]] = ...,
|
||||
error_class: Type[ErrorList] = ...,
|
||||
label_suffix: None = ...,
|
||||
empty_permitted: bool = ...,
|
||||
instance: Optional[Model] = ...,
|
||||
use_required_attribute: None = ...,
|
||||
renderer: Any = ...,
|
||||
) -> None: ...
|
||||
def clean(self) -> Dict[str, Any]: ...
|
||||
def validate_unique(self) -> None: ...
|
||||
save_m2m: Any = ...
|
||||
def save(self, commit: bool = ...) -> Model: ...
|
||||
|
||||
class ModelForm(BaseModelForm): ...
|
||||
|
||||
def modelform_factory(
|
||||
model: Type[Model],
|
||||
form: Type[ModelForm] = ...,
|
||||
fields: Optional[Union[List[str], str]] = ...,
|
||||
exclude: None = ...,
|
||||
formfield_callback: Optional[str] = ...,
|
||||
widgets: None = ...,
|
||||
localized_fields: None = ...,
|
||||
labels: None = ...,
|
||||
help_texts: None = ...,
|
||||
error_messages: None = ...,
|
||||
field_classes: None = ...,
|
||||
) -> Any: ...
|
||||
|
||||
class BaseModelFormSet(BaseFormSet):
|
||||
model: Any = ...
|
||||
unique_fields: Any = ...
|
||||
queryset: Any = ...
|
||||
initial_extra: Any = ...
|
||||
def __init__(
|
||||
self,
|
||||
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: Type[Model],
|
||||
form: Type[ModelForm] = ...,
|
||||
formfield_callback: None = ...,
|
||||
formset: Type[BaseModelFormSet] = ...,
|
||||
extra: int = ...,
|
||||
can_delete: bool = ...,
|
||||
can_order: bool = ...,
|
||||
max_num: None = ...,
|
||||
fields: None = ...,
|
||||
exclude: None = ...,
|
||||
widgets: None = ...,
|
||||
validate_max: bool = ...,
|
||||
localized_fields: None = ...,
|
||||
labels: None = ...,
|
||||
help_texts: None = ...,
|
||||
error_messages: None = ...,
|
||||
min_num: None = ...,
|
||||
validate_min: bool = ...,
|
||||
field_classes: None = ...,
|
||||
) -> 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: Type[Model],
|
||||
model: Type[Model],
|
||||
form: Type[ModelForm] = ...,
|
||||
formset: Type[BaseInlineFormSet] = ...,
|
||||
fk_name: Optional[str] = ...,
|
||||
fields: Optional[str] = ...,
|
||||
exclude: None = ...,
|
||||
extra: int = ...,
|
||||
can_order: bool = ...,
|
||||
can_delete: bool = ...,
|
||||
max_num: None = ...,
|
||||
formfield_callback: None = ...,
|
||||
widgets: None = ...,
|
||||
validate_max: bool = ...,
|
||||
localized_fields: None = ...,
|
||||
labels: None = ...,
|
||||
help_texts: None = ...,
|
||||
error_messages: None = ...,
|
||||
min_num: None = ...,
|
||||
validate_min: bool = ...,
|
||||
field_classes: None = ...,
|
||||
) -> Any: ...
|
||||
|
||||
class InlineForeignKeyField(Field):
|
||||
disabled: bool
|
||||
help_text: str
|
||||
initial: Optional[Union[django.db.models.base.Model, int, str]]
|
||||
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[Union[int, str]]) -> Optional[Model]: ...
|
||||
def has_changed(self, initial: Optional[Union[int, str]], data: Optional[Union[int, str]]) -> bool: ...
|
||||
|
||||
class ModelChoiceIterator:
|
||||
field: django.forms.models.ModelChoiceField = ...
|
||||
queryset: Optional[django.db.models.query.QuerySet] = ...
|
||||
def __init__(self, field: ModelChoiceField) -> None: ...
|
||||
def __iter__(self) -> Iterator[Tuple[Union[int, str], str]]: ...
|
||||
def __len__(self) -> int: ...
|
||||
def __bool__(self) -> bool: ...
|
||||
def choice(self, obj: Model) -> Tuple[int, str]: ...
|
||||
|
||||
class ModelChoiceField(ChoiceField):
|
||||
disabled: bool
|
||||
error_messages: Dict[str, str]
|
||||
help_text: str
|
||||
initial: Optional[Union[Callable, int, str, uuid.UUID]]
|
||||
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: Optional[Union[Manager, QuerySet]],
|
||||
*,
|
||||
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) -> Optional[Union[Dict[str, datetime], Q, MagicMock]]: ...
|
||||
def __deepcopy__(
|
||||
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 validate(self, value: Optional[Model]) -> None: ...
|
||||
def has_changed(self, initial: Optional[Union[Model, int, str, UUID]], data: Optional[Union[int, str]]) -> bool: ...
|
||||
|
||||
class ModelMultipleChoiceField(ModelChoiceField):
|
||||
disabled: bool
|
||||
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: 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 has_changed(
|
||||
self, initial: Optional[Union[List[Model], QuerySet, str]], data: Optional[Union[List[int], List[str], str]]
|
||||
) -> bool: ...
|
||||
@@ -0,0 +1,30 @@
|
||||
from typing import Any, Dict, Union
|
||||
|
||||
import django.template.backends as template_backends
|
||||
from django.template import Template
|
||||
from django.template.backends.base import BaseEngine
|
||||
|
||||
ROOT: Any
|
||||
|
||||
def get_default_renderer() -> DjangoTemplates: ...
|
||||
|
||||
class BaseRenderer:
|
||||
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
|
||||
) -> Union[template_backends.django.Template, template_backends.jinja2.Template]: ...
|
||||
def engine(self) -> BaseEngine: ...
|
||||
|
||||
class DjangoTemplates(EngineMixin, BaseRenderer):
|
||||
engine: template_backends.django.DjangoTemplates
|
||||
backend: Any = ...
|
||||
|
||||
class Jinja2(EngineMixin, BaseRenderer):
|
||||
engine: template_backends.jinja2.Jinja2
|
||||
backend: Any = ...
|
||||
|
||||
class TemplatesSetting(BaseRenderer):
|
||||
def get_template(self, template_name: str) -> Template: ...
|
||||
@@ -0,0 +1,35 @@
|
||||
from collections import UserList
|
||||
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
|
||||
|
||||
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 as_json(self, escape_html: bool = ...) -> str: ...
|
||||
def as_ul(self) -> str: ...
|
||||
def as_text(self) -> str: ...
|
||||
|
||||
class ErrorList(UserList, list):
|
||||
data: List[Union[ValidationError, str]]
|
||||
error_class: str = ...
|
||||
def __init__(self, initlist: Optional[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 = ...) -> str: ...
|
||||
def as_ul(self) -> str: ...
|
||||
def as_text(self) -> str: ...
|
||||
def __contains__(self, item: str) -> bool: ...
|
||||
def __eq__(self, other: Union[List[str], ErrorList]) -> bool: ...
|
||||
def __getitem__(self, i: Union[int, str]) -> str: ...
|
||||
def __reduce_ex__(
|
||||
self, *args: Any, **kwargs: Any
|
||||
) -> 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: ...
|
||||
@@ -0,0 +1,454 @@
|
||||
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 django.contrib.admin.options import BaseModelAdmin
|
||||
from django.core.files.base import File
|
||||
from django.core.files.uploadedfile import SimpleUploadedFile
|
||||
from django.db.models.fields.files import FieldFile
|
||||
from django.forms.fields import Field
|
||||
from django.forms.forms import BaseForm
|
||||
from django.forms.renderers import EngineMixin
|
||||
from django.http.request import QueryDict
|
||||
from django.utils.datastructures import MultiValueDict
|
||||
from django.utils.safestring import SafeText
|
||||
|
||||
class MediaOrderConflictWarning(RuntimeWarning): ...
|
||||
|
||||
class Media:
|
||||
def __init__(
|
||||
self,
|
||||
media: Optional[Type[Any]] = ...,
|
||||
css: Optional[Union[Dict[str, List[str]], Dict[str, Tuple[str]]]] = ...,
|
||||
js: Optional[Union[List[str], Tuple[str]]] = ...,
|
||||
) -> None: ...
|
||||
def render(self) -> SafeText: ...
|
||||
def render_js(self) -> List[SafeText]: ...
|
||||
def render_css(self) -> chain: ...
|
||||
def absolute_path(self, path: str) -> str: ...
|
||||
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]]
|
||||
) -> Union[List[int], List[str]]: ...
|
||||
def __add__(self, other: Media) -> Media: ...
|
||||
|
||||
class MediaDefiningClass(type):
|
||||
def __new__(
|
||||
mcs: Type[MediaDefiningClass], name: str, bases: Tuple, attrs: Any
|
||||
) -> Type[Union[BaseModelAdmin, BaseForm, Widget]]: ...
|
||||
|
||||
class Widget:
|
||||
needs_multipart_form: bool = ...
|
||||
is_localized: bool = ...
|
||||
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: ...
|
||||
@property
|
||||
def is_hidden(self) -> bool: ...
|
||||
def subwidgets(
|
||||
self, name: str, value: None, attrs: Dict[str, bool] = ...
|
||||
) -> 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]]]) -> Dict[str, Any]: ...
|
||||
def render(
|
||||
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]]] = ...
|
||||
) -> Dict[str, Union[Decimal, float, str]]: ...
|
||||
def value_from_datadict(
|
||||
self, data: dict, files: Union[Dict[str, SimpleUploadedFile], MultiValueDict], name: str
|
||||
) -> Any: ...
|
||||
def value_omitted_from_data(
|
||||
self, data: Dict[str, Any], files: Union[Dict[str, SimpleUploadedFile], MultiValueDict], name: str
|
||||
) -> bool: ...
|
||||
def id_for_label(self, id_: str) -> str: ...
|
||||
def use_required_attribute(self, initial: Any) -> bool: ...
|
||||
|
||||
class Input(Widget):
|
||||
attrs: Dict[Any, Any]
|
||||
input_type: str = ...
|
||||
template_name: str = ...
|
||||
def __init__(
|
||||
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]]]) -> Dict[str, Any]: ...
|
||||
|
||||
class TextInput(Input):
|
||||
attrs: Dict[str, Optional[bool]]
|
||||
is_localized: bool
|
||||
is_required: bool
|
||||
input_type: str = ...
|
||||
template_name: str = ...
|
||||
|
||||
class NumberInput(Input):
|
||||
attrs: Dict[str, Union[float, str]]
|
||||
is_required: bool
|
||||
input_type: str = ...
|
||||
template_name: str = ...
|
||||
|
||||
class EmailInput(Input):
|
||||
attrs: Dict[str, Union[bool, str]]
|
||||
is_required: bool
|
||||
input_type: str = ...
|
||||
template_name: str = ...
|
||||
|
||||
class URLInput(Input):
|
||||
attrs: Dict[str, str]
|
||||
is_required: bool
|
||||
input_type: str = ...
|
||||
template_name: str = ...
|
||||
|
||||
class PasswordInput(Input):
|
||||
attrs: Dict[str, Union[bool, str]]
|
||||
is_required: bool
|
||||
input_type: str = ...
|
||||
template_name: str = ...
|
||||
render_value: bool = ...
|
||||
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]]]]: ...
|
||||
|
||||
class HiddenInput(Input):
|
||||
attrs: Dict[str, str]
|
||||
choices: django.forms.models.ModelChoiceIterator
|
||||
is_localized: bool
|
||||
is_required: 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: Optional[Union[List[int], List[str]]], attrs: Optional[Dict[str, str]]
|
||||
) -> Dict[str, Any]: ...
|
||||
def value_from_datadict(
|
||||
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]]: ...
|
||||
|
||||
class FileInput(Input):
|
||||
attrs: Dict[str, Union[bool, str]]
|
||||
is_required: bool
|
||||
input_type: str = ...
|
||||
needs_multipart_form: bool = ...
|
||||
template_name: str = ...
|
||||
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],
|
||||
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
|
||||
) -> bool: ...
|
||||
|
||||
class ClearableFileInput(FileInput):
|
||||
attrs: Dict[str, str]
|
||||
is_required: bool
|
||||
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: Optional[Union[File, str]]) -> bool: ...
|
||||
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],
|
||||
files: Dict[str, Union[SimpleUploadedFile, str]],
|
||||
name: str,
|
||||
) -> Any: ...
|
||||
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
|
||||
) -> 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: ...
|
||||
|
||||
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]: ...
|
||||
|
||||
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 = ...
|
||||
|
||||
class CheckboxInput(Input):
|
||||
attrs: Dict[str, str]
|
||||
is_required: bool
|
||||
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 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]]]]: ...
|
||||
def value_from_datadict(
|
||||
self,
|
||||
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],
|
||||
files: Union[Dict[Any, Any], MultiValueDict],
|
||||
name: str,
|
||||
) -> bool: ...
|
||||
|
||||
class ChoiceWidget(Widget):
|
||||
allow_multiple_selected: bool = ...
|
||||
input_type: Any = ...
|
||||
template_name: Any = ...
|
||||
option_template_name: Any = ...
|
||||
add_id_index: bool = ...
|
||||
checked_attribute: Any = ...
|
||||
option_inherits_attrs: bool = ...
|
||||
choices: Any = ...
|
||||
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
|
||||
] = ...,
|
||||
) -> 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 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]]: ...
|
||||
def create_option(
|
||||
self,
|
||||
name: str,
|
||||
value: Union[time, int, str],
|
||||
label: Union[int, str],
|
||||
selected: Union[Set[str], bool],
|
||||
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]]: ...
|
||||
def get_context(
|
||||
self,
|
||||
name: str,
|
||||
value: Optional[Union[List[int], List[str], Tuple[str, str], int, str]],
|
||||
attrs: Optional[Dict[str, Union[bool, str]]],
|
||||
) -> Dict[str, Any]: ...
|
||||
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
|
||||
) -> Optional[Union[List[str], int, 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]]
|
||||
choices: List[List[Union[int, str]]]
|
||||
is_required: bool
|
||||
input_type: str = ...
|
||||
template_name: str = ...
|
||||
option_template_name: str = ...
|
||||
add_id_index: bool = ...
|
||||
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]]],
|
||||
) -> Dict[str, Any]: ...
|
||||
def use_required_attribute(self, initial: Any) -> bool: ...
|
||||
|
||||
class NullBooleanSelect(Select):
|
||||
attrs: Dict[Any, Any]
|
||||
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: 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
|
||||
]
|
||||
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],
|
||||
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: ...
|
||||
|
||||
class RadioSelect(ChoiceWidget):
|
||||
attrs: Dict[str, str]
|
||||
choices: Union[
|
||||
List[Tuple[datetime.time, Union[Tuple[Tuple[str, str], Tuple[str, str]], str]]],
|
||||
List[int],
|
||||
django.forms.models.ModelChoiceIterator,
|
||||
]
|
||||
is_required: bool
|
||||
input_type: str = ...
|
||||
template_name: str = ...
|
||||
option_template_name: str = ...
|
||||
|
||||
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,
|
||||
]
|
||||
is_required: bool
|
||||
allow_multiple_selected: bool = ...
|
||||
input_type: str = ...
|
||||
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 id_for_label(self, id_: str, index: Optional[str] = ...) -> str: ...
|
||||
|
||||
class MultiWidget(Widget):
|
||||
attrs: Dict[Any, Any]
|
||||
template_name: str = ...
|
||||
widgets: List[django.forms.widgets.Widget] = ...
|
||||
def __init__(
|
||||
self,
|
||||
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]]],
|
||||
) -> Dict[str, Any]: ...
|
||||
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,
|
||||
) -> 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
|
||||
) -> 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]]
|
||||
) -> MultiWidget: ...
|
||||
@property
|
||||
def needs_multipart_form(self) -> bool: ...
|
||||
|
||||
class SplitDateTimeWidget(MultiWidget):
|
||||
attrs: Dict[Any, Any]
|
||||
is_required: bool
|
||||
widgets: List[django.forms.widgets.DateTimeBaseInput]
|
||||
supports_microseconds: bool = ...
|
||||
template_name: str = ...
|
||||
def __init__(
|
||||
self,
|
||||
attrs: Optional[Dict[str, str]] = ...,
|
||||
date_format: Optional[str] = ...,
|
||||
time_format: Optional[str] = ...,
|
||||
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]]: ...
|
||||
|
||||
class SplitHiddenDateTimeWidget(SplitDateTimeWidget):
|
||||
attrs: Dict[Any, Any]
|
||||
is_required: bool
|
||||
widgets: List[django.forms.widgets.DateTimeBaseInput]
|
||||
template_name: str = ...
|
||||
def __init__(
|
||||
self,
|
||||
attrs: Optional[Dict[str, str]] = ...,
|
||||
date_format: None = ...,
|
||||
time_format: None = ...,
|
||||
date_attrs: Optional[Dict[str, str]] = ...,
|
||||
time_attrs: Optional[Dict[str, str]] = ...,
|
||||
) -> None: ...
|
||||
|
||||
class SelectDateWidget(Widget):
|
||||
none_value: Any = ...
|
||||
month_field: str = ...
|
||||
day_field: str = ...
|
||||
year_field: str = ...
|
||||
template_name: str = ...
|
||||
input_type: str = ...
|
||||
select_widget: Any = ...
|
||||
date_re: Any = ...
|
||||
attrs: Any = ...
|
||||
years: Any = ...
|
||||
months: Any = ...
|
||||
year_none_value: Any = ...
|
||||
month_none_value: Any = ...
|
||||
day_none_value: Any = ...
|
||||
def __init__(
|
||||
self,
|
||||
attrs: None = ...,
|
||||
years: Optional[Union[Tuple[Union[int, str]], range]] = ...,
|
||||
months: None = ...,
|
||||
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 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: ...
|
||||
Reference in New Issue
Block a user