mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-13 15:31:55 +08:00
improved version
This commit is contained in:
@@ -1,11 +1,13 @@
|
||||
from django.forms.fields import Field
|
||||
from django.forms.forms import BaseForm
|
||||
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 (
|
||||
@@ -20,9 +22,14 @@ from typing import (
|
||||
class BoundField:
|
||||
def __getitem__(
|
||||
self,
|
||||
idx: Union[str, slice, int]
|
||||
) -> Union[BoundWidget, List[BoundWidget]]: ...
|
||||
def __init__(self, form: BaseForm, field: Field, name: str) -> None: ...
|
||||
idx: Union[slice, str, int]
|
||||
) -> Union[List[BoundWidget], BoundWidget]: ...
|
||||
def __init__(
|
||||
self,
|
||||
form: Union[Form, ModelForm],
|
||||
field: Field,
|
||||
name: str
|
||||
) -> None: ...
|
||||
def __len__(self) -> int: ...
|
||||
def as_hidden(self, attrs: None = ..., **kwargs) -> SafeText: ...
|
||||
def as_text(self, attrs: None = ..., **kwargs) -> SafeText: ...
|
||||
@@ -35,7 +42,11 @@ class BoundField:
|
||||
) -> SafeText: ...
|
||||
@property
|
||||
def auto_id(self) -> str: ...
|
||||
def build_widget_attrs(self, attrs: Dict[str, str], widget: Any = ...) -> Dict[str, Union[bool, str]]: ...
|
||||
def build_widget_attrs(
|
||||
self,
|
||||
attrs: Dict[str, str],
|
||||
widget: Optional[Widget] = ...
|
||||
) -> Dict[str, Union[bool, str]]: ...
|
||||
def css_classes(self, extra_classes: None = ...) -> str: ...
|
||||
@property
|
||||
def data(self) -> Any: ...
|
||||
|
||||
@@ -8,10 +8,12 @@ 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 BaseForm
|
||||
from django.forms.forms import Form
|
||||
from django.forms.models import ModelForm
|
||||
from django.forms.widgets import (
|
||||
ClearableFileInput,
|
||||
Input,
|
||||
Textarea,
|
||||
Widget,
|
||||
)
|
||||
from typing import (
|
||||
@@ -51,8 +53,8 @@ class CharField:
|
||||
empty_value = ...,
|
||||
**kwargs
|
||||
) -> None: ...
|
||||
def to_python(self, value: Optional[Union[int, Tuple, str]]) -> Optional[str]: ...
|
||||
def widget_attrs(self, widget: Widget) -> Dict[str, str]: ...
|
||||
def to_python(self, value: Optional[Union[int, str, Tuple]]) -> Optional[str]: ...
|
||||
def widget_attrs(self, widget: Union[Textarea, Input]) -> Dict[str, str]: ...
|
||||
|
||||
|
||||
class ChoiceField:
|
||||
@@ -122,9 +124,13 @@ class Field:
|
||||
disabled = ...,
|
||||
label_suffix = ...
|
||||
) -> None: ...
|
||||
def bound_data(self, data: Any, initial: Any) -> Any: ...
|
||||
def bound_data(self, data: Any, initial: Optional[Union[str, float, datetime]]) -> Any: ...
|
||||
def clean(self, value: Any) -> Any: ...
|
||||
def get_bound_field(self, form: BaseForm, field_name: str) -> BoundField: ...
|
||||
def get_bound_field(
|
||||
self,
|
||||
form: Union[Form, ModelForm],
|
||||
field_name: str
|
||||
) -> BoundField: ...
|
||||
def has_changed(self, initial: Any, data: Optional[str]) -> bool: ...
|
||||
def prepare_value(self, value: Any) -> Any: ...
|
||||
def run_validators(self, value: Any) -> None: ...
|
||||
@@ -142,7 +148,7 @@ class FileField:
|
||||
) -> Union[str, SimpleUploadedFile]: ...
|
||||
def clean(
|
||||
self,
|
||||
data: Optional[Union[str, bool, SimpleUploadedFile]],
|
||||
data: Optional[Union[bool, str, SimpleUploadedFile]],
|
||||
initial: Optional[Union[str, FieldFile]] = ...
|
||||
) -> Any: ...
|
||||
def has_changed(self, initial: Union[str, FieldFile], data: Optional[str]) -> bool: ...
|
||||
@@ -182,22 +188,22 @@ class ImageField:
|
||||
|
||||
class IntegerField:
|
||||
def __init__(self, *, max_value = ..., min_value = ..., **kwargs) -> None: ...
|
||||
def to_python(self, value: Optional[Union[float, int, str]]) -> Optional[int]: ...
|
||||
def widget_attrs(self, widget: Input) -> Dict[str, Union[Decimal, int]]: ...
|
||||
def to_python(self, value: Optional[Union[str, float]]) -> Optional[int]: ...
|
||||
def widget_attrs(self, widget: Input) -> Dict[str, Union[int, Decimal]]: ...
|
||||
|
||||
|
||||
class MultiValueField:
|
||||
def __deepcopy__(self, memo: Dict[int, Any]) -> MultiValueField: ...
|
||||
def __init__(
|
||||
self,
|
||||
fields: Union[Tuple[DateField, TimeField], Tuple[CharField, MultipleChoiceField, SplitDateTimeField], Tuple[CharField, CharField]],
|
||||
fields: Union[Tuple[CharField, MultipleChoiceField, SplitDateTimeField], Tuple[DateField, TimeField], Tuple[CharField, CharField]],
|
||||
*,
|
||||
require_all_fields = ...,
|
||||
**kwargs
|
||||
) -> None: ...
|
||||
def clean(
|
||||
self,
|
||||
value: Union[str, List[Union[str, List[str]]], List[str]]
|
||||
value: Union[str, List[str], List[Union[str, List[str]]]]
|
||||
) -> Optional[Union[str, datetime]]: ...
|
||||
def has_changed(
|
||||
self,
|
||||
@@ -209,7 +215,7 @@ class MultiValueField:
|
||||
|
||||
class MultipleChoiceField:
|
||||
def has_changed(self, initial: Optional[Union[str, List[int]]], data: Union[str, List[str]]) -> bool: ...
|
||||
def to_python(self, value: Optional[Union[Tuple, str, List[str]]]) -> List[str]: ...
|
||||
def to_python(self, value: Optional[Union[str, List[str], Tuple]]) -> List[str]: ...
|
||||
def validate(self, value: List[str]) -> None: ...
|
||||
|
||||
|
||||
@@ -239,14 +245,14 @@ class TimeField:
|
||||
|
||||
class TypedChoiceField:
|
||||
def __init__(self, *, coerce = ..., empty_value = ..., **kwargs) -> None: ...
|
||||
def _coerce(self, value: Optional[Union[str, int]]) -> Optional[Union[int, str]]: ...
|
||||
def _coerce(self, value: Optional[Union[str, int]]) -> Optional[Union[str, int]]: ...
|
||||
def clean(self, value: Optional[str]) -> Optional[Union[str, int]]: ...
|
||||
|
||||
|
||||
class TypedMultipleChoiceField:
|
||||
def __init__(self, *, coerce = ..., **kwargs) -> None: ...
|
||||
def _coerce(self, value: List[str]) -> Optional[Union[List[Decimal], List[int]]]: ...
|
||||
def clean(self, value: List[str]) -> Optional[Union[List[bool], List[int]]]: ...
|
||||
def clean(self, value: List[str]) -> Optional[Union[List[int], List[bool]]]: ...
|
||||
def validate(self, value: List[str]) -> None: ...
|
||||
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ class BaseForm:
|
||||
def __init__(
|
||||
self,
|
||||
data: Any = ...,
|
||||
files: Optional[Union[Dict[str, SimpleUploadedFile], MultiValueDict]] = ...,
|
||||
files: Optional[Union[MultiValueDict, Dict[str, SimpleUploadedFile]]] = ...,
|
||||
auto_id: Optional[Union[str, bool]] = ...,
|
||||
prefix: Optional[str] = ...,
|
||||
initial: Any = ...,
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
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 django.db.models.base import Model
|
||||
@@ -21,8 +25,8 @@ from uuid import UUID
|
||||
|
||||
|
||||
def _get_foreign_key(
|
||||
parent_model: Any,
|
||||
model: Any,
|
||||
parent_model: Type[Model],
|
||||
model: Type[Model],
|
||||
fk_name: Optional[str] = ...,
|
||||
can_fail: bool = ...
|
||||
) -> ForeignKey: ...
|
||||
@@ -42,7 +46,7 @@ class BaseModelForm:
|
||||
error_class: Type[ErrorList] = ...,
|
||||
label_suffix: None = ...,
|
||||
empty_permitted: bool = ...,
|
||||
instance: Any = ...,
|
||||
instance: Optional[Model] = ...,
|
||||
use_required_attribute: None = ...,
|
||||
renderer: None = ...
|
||||
) -> None: ...
|
||||
@@ -88,17 +92,17 @@ class ModelChoiceField:
|
||||
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[int, UUID]], data: Optional[Union[str, int]]) -> bool: ...
|
||||
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[UUID, str, int]]: ...
|
||||
def to_python(self, value: Optional[Union[str, List[List[str]], int]]) -> Any: ...
|
||||
def validate(self, value: Any) -> None: ...
|
||||
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[int, str], Tuple[str, str]]]: ...
|
||||
def __iter__(self) -> Iterator[Union[Tuple[str, str], Tuple[int, str]]]: ...
|
||||
def __len__(self) -> int: ...
|
||||
def choice(self, obj: Model) -> Tuple[int, str]: ...
|
||||
|
||||
@@ -110,11 +114,14 @@ class ModelFormMetaclass:
|
||||
name: str,
|
||||
bases: Tuple[Type[ModelForm]],
|
||||
attrs: OrderedDict
|
||||
) -> Any: ...
|
||||
) -> Type[ModelForm]: ...
|
||||
|
||||
|
||||
class ModelFormOptions:
|
||||
def __init__(self, options: Any = ...) -> None: ...
|
||||
def __init__(
|
||||
self,
|
||||
options: Optional[Union[Type[object], Type[UserChangeForm.Meta], Type[UserCreationForm.Meta]]] = ...
|
||||
) -> None: ...
|
||||
|
||||
|
||||
class ModelMultipleChoiceField:
|
||||
@@ -123,7 +130,7 @@ class ModelMultipleChoiceField:
|
||||
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], List[str]]
|
||||
) -> QuerySet: ...
|
||||
def clean(self, value: Union[List[List[str]], str, List[int], 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(
|
||||
|
||||
@@ -12,7 +12,7 @@ from typing import (
|
||||
)
|
||||
|
||||
|
||||
def flatatt(attrs: Dict[str, Union[str, None]]) -> SafeText: ...
|
||||
def flatatt(attrs: Dict[str, Optional[str]]) -> SafeText: ...
|
||||
|
||||
|
||||
def from_current_timezone(value: datetime) -> datetime: ...
|
||||
@@ -33,11 +33,11 @@ class ErrorDict:
|
||||
|
||||
class ErrorList:
|
||||
def __contains__(self, item: str) -> bool: ...
|
||||
def __eq__(self, other: Union[List[str], ErrorList]) -> bool: ...
|
||||
def __eq__(self, other: Union[ErrorList, List[str]]) -> bool: ...
|
||||
def __getitem__(self, i: Union[str, int]) -> str: ...
|
||||
def __init__(
|
||||
self,
|
||||
initlist: Optional[Union[List[ValidationError], ErrorList, List[str]]] = ...,
|
||||
initlist: Optional[Union[ErrorList, List[str], List[ValidationError]]] = ...,
|
||||
error_class: Optional[str] = ...
|
||||
) -> None: ...
|
||||
def __reduce_ex__(
|
||||
|
||||
@@ -30,18 +30,18 @@ class CheckboxInput:
|
||||
def get_context(
|
||||
self,
|
||||
name: str,
|
||||
value: Optional[Union[str, int]],
|
||||
attrs: Optional[Union[Dict[str, bool], Dict[str, Union[bool, str]], Dict[str, str]]]
|
||||
) -> Dict[str, Any]: ...
|
||||
value: Optional[Union[int, str]],
|
||||
attrs: Optional[Union[Dict[str, Union[bool, str]], Dict[str, bool], Dict[str, str]]]
|
||||
) -> Dict[str, Dict[str, Any]]: ...
|
||||
def value_from_datadict(
|
||||
self,
|
||||
data: Any,
|
||||
files: Union[Dict[str, SimpleUploadedFile], MultiValueDict],
|
||||
files: Union[MultiValueDict, Dict[str, SimpleUploadedFile]],
|
||||
name: str
|
||||
) -> bool: ...
|
||||
def value_omitted_from_data(
|
||||
self,
|
||||
data: Union[Dict[str, str], Dict[str, Union[str, List[int]]], Dict[str, Union[int, str, None, datetime]], QueryDict],
|
||||
data: Union[Dict[str, Union[str, List[int]]], Dict[str, str], Dict[str, Union[int, str, None, datetime]], QueryDict],
|
||||
files: MultiValueDict,
|
||||
name: str
|
||||
) -> bool: ...
|
||||
@@ -68,30 +68,30 @@ class ChoiceWidget:
|
||||
selected: Union[bool, Set[str]],
|
||||
index: int,
|
||||
subindex: Optional[int] = ...,
|
||||
attrs: Optional[Union[Dict[str, bool], Dict[str, Union[bool, str]], Dict[str, str]]] = ...
|
||||
attrs: Optional[Union[Dict[str, Union[bool, str]], Dict[str, bool], Dict[str, str]]] = ...
|
||||
) -> Dict[str, Any]: ...
|
||||
def format_value(self, value: Any) -> List[str]: ...
|
||||
def get_context(
|
||||
self,
|
||||
name: str,
|
||||
value: Any,
|
||||
attrs: Optional[Union[Dict[str, bool], Dict[str, Union[bool, str]], Dict[str, str]]]
|
||||
) -> Dict[str, Any]: ...
|
||||
attrs: Optional[Union[Dict[str, Union[bool, str]], Dict[str, bool], Dict[str, str]]]
|
||||
) -> Dict[str, Dict[str, Any]]: ...
|
||||
def id_for_label(self, id_: str, index: str = ...) -> str: ...
|
||||
def optgroups(
|
||||
self,
|
||||
name: str,
|
||||
value: List[str],
|
||||
attrs: Optional[Union[Dict[str, bool], Dict[str, Union[bool, str]], Dict[str, str]]] = ...
|
||||
attrs: Optional[Union[Dict[str, Union[bool, str]], Dict[str, bool], Dict[str, str]]] = ...
|
||||
) -> Any: ...
|
||||
def options(self, name: str, value: List[str], attrs: Dict[str, Union[bool, str]] = ...) -> None: ...
|
||||
def subwidgets(self, name: str, value: Optional[List[str]], attrs: Dict[str, Union[bool, str]] = ...) -> None: ...
|
||||
def value_from_datadict(
|
||||
self,
|
||||
data: Any,
|
||||
data: dict,
|
||||
files: MultiValueDict,
|
||||
name: str
|
||||
) -> Optional[Union[str, int, List[str]]]: ...
|
||||
) -> Optional[Union[str, List[str], int]]: ...
|
||||
|
||||
|
||||
class ClearableFileInput:
|
||||
@@ -101,12 +101,12 @@ class ClearableFileInput:
|
||||
self,
|
||||
value: Optional[Union[str, FieldFile]]
|
||||
) -> Optional[FieldFile]: ...
|
||||
def is_initial(self, value: Any) -> bool: ...
|
||||
def is_initial(self, value: object) -> bool: ...
|
||||
def use_required_attribute(self, initial: Optional[FieldFile]) -> bool: ...
|
||||
def value_from_datadict(
|
||||
self,
|
||||
data: Union[Dict[str, bool], Dict[str, str], Dict[str, None], QueryDict],
|
||||
files: Dict[str, Union[str, SimpleUploadedFile]],
|
||||
data: Union[Dict[str, bool], Dict[str, None], Dict[str, str], QueryDict],
|
||||
files: Dict[str, Union[SimpleUploadedFile, str]],
|
||||
name: str
|
||||
) -> Optional[Union[str, SimpleUploadedFile]]: ...
|
||||
def value_omitted_from_data(self, data: Dict[str, str], files: Dict[Any, Any], name: str) -> bool: ...
|
||||
@@ -121,26 +121,26 @@ class FileInput:
|
||||
def format_value(self, value: None) -> None: ...
|
||||
def value_from_datadict(
|
||||
self,
|
||||
data: Union[Dict[str, bool], Dict[str, str], QueryDict],
|
||||
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[str, SimpleUploadedFile]],
|
||||
files: Dict[str, Union[SimpleUploadedFile, str]],
|
||||
name: str
|
||||
) -> bool: ...
|
||||
|
||||
|
||||
class Input:
|
||||
def __init__(self, attrs: Optional[Union[Dict[str, str], Dict[str, bool], Dict[str, int]]] = ...) -> None: ...
|
||||
def __init__(self, attrs: Optional[Union[Dict[str, int], Dict[str, str], Dict[str, bool]]] = ...) -> None: ...
|
||||
def get_context(
|
||||
self,
|
||||
name: str,
|
||||
value: Any,
|
||||
attrs: Optional[Union[Dict[str, bool], Dict[str, Union[bool, str]], Dict[str, str]]]
|
||||
) -> Dict[str, Any]: ...
|
||||
attrs: Optional[Union[Dict[str, Union[bool, str]], Dict[str, bool], Dict[str, str]]]
|
||||
) -> Dict[str, Dict[str, Any]]: ...
|
||||
|
||||
|
||||
class Media:
|
||||
@@ -149,13 +149,13 @@ class Media:
|
||||
def __init__(
|
||||
self,
|
||||
media: Optional[Type[object]] = ...,
|
||||
css: Optional[Union[Dict[str, Tuple[str, str]], Dict[str, Tuple[str]], Dict[str, List[str]]]] = ...,
|
||||
css: Optional[Union[Dict[str, Tuple[str, str]], Dict[str, List[str]], Dict[str, Tuple[str]]]] = ...,
|
||||
js: Any = ...
|
||||
) -> None: ...
|
||||
def __repr__(self) -> str: ...
|
||||
def absolute_path(self, path: str) -> str: ...
|
||||
@staticmethod
|
||||
def merge(list_1: Union[List[str], Tuple[str], List[int]], list_2: Any) -> Union[List[int], List[str]]: ...
|
||||
def merge(list_1: Union[List[int], List[str], Tuple[str]], list_2: Any) -> Union[List[int], List[str]]: ...
|
||||
def render(self) -> SafeText: ...
|
||||
def render_css(self) -> chain: ...
|
||||
def render_js(self) -> List[SafeText]: ...
|
||||
@@ -163,7 +163,7 @@ class Media:
|
||||
|
||||
class MediaDefiningClass:
|
||||
@staticmethod
|
||||
def __new__(mcs: Type[MediaDefiningClass], name: str, bases: Tuple, attrs: Any) -> Any: ...
|
||||
def __new__(mcs: Type[MediaDefiningClass], name: str, bases: Tuple, attrs: Any) -> Type[Any]: ...
|
||||
|
||||
|
||||
class MultiWidget:
|
||||
@@ -174,8 +174,8 @@ class MultiWidget:
|
||||
self,
|
||||
name: str,
|
||||
value: Optional[Union[str, datetime, List[str]]],
|
||||
attrs: Optional[Union[Dict[str, Union[bool, str]], Dict[str, str]]]
|
||||
) -> Dict[str, Any]: ...
|
||||
attrs: Optional[Union[Dict[str, Union[str, bool]], Dict[str, str]]]
|
||||
) -> Dict[str, Dict[str, Any]]: ...
|
||||
def id_for_label(self, id_: str) -> str: ...
|
||||
@property
|
||||
def is_hidden(self) -> bool: ...
|
||||
@@ -209,7 +209,7 @@ class MultipleHiddenInput:
|
||||
class NullBooleanSelect:
|
||||
def __init__(self, attrs: None = ...) -> None: ...
|
||||
def format_value(self, value: Optional[str]) -> str: ...
|
||||
def value_from_datadict(self, data: Dict[str, Union[bool, str]], files: Dict[Any, Any], name: str) -> Optional[bool]: ...
|
||||
def value_from_datadict(self, data: Dict[str, Union[str, bool]], files: Dict[Any, Any], name: str) -> Optional[bool]: ...
|
||||
|
||||
|
||||
class PasswordInput:
|
||||
@@ -218,7 +218,7 @@ class PasswordInput:
|
||||
self,
|
||||
name: str,
|
||||
value: Optional[str],
|
||||
attrs: Optional[Union[Dict[str, Union[bool, str]], Dict[str, bool]]]
|
||||
attrs: Optional[Union[Dict[str, Union[str, bool]], Dict[str, bool]]]
|
||||
) -> Dict[str, Dict[str, Any]]: ...
|
||||
|
||||
|
||||
@@ -229,8 +229,8 @@ class Select:
|
||||
self,
|
||||
name: str,
|
||||
value: Any,
|
||||
attrs: Optional[Union[Dict[str, bool], Dict[str, Union[bool, str]], Dict[str, str]]]
|
||||
) -> Dict[str, Any]: ...
|
||||
attrs: Optional[Union[Dict[str, Union[str, bool]], Dict[str, bool], Dict[str, str]]]
|
||||
) -> Dict[str, Dict[str, Any]]: ...
|
||||
def use_required_attribute(self, initial: Any) -> bool: ...
|
||||
|
||||
|
||||
@@ -244,7 +244,7 @@ class SelectDateWidget:
|
||||
) -> None: ...
|
||||
@staticmethod
|
||||
def _parse_date_fmt() -> Iterator[str]: ...
|
||||
def format_value(self, value: Optional[Union[str, date]]) -> Dict[str, Union[None, int, str]]: ...
|
||||
def format_value(self, value: Optional[Union[str, date]]) -> Dict[str, Optional[Union[str, int]]]: ...
|
||||
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: ...
|
||||
|
||||
@@ -255,7 +255,7 @@ class SelectMultiple:
|
||||
data: Any,
|
||||
files: MultiValueDict,
|
||||
name: str
|
||||
) -> Optional[Union[str, List[int], List[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: ...
|
||||
|
||||
|
||||
@@ -271,7 +271,7 @@ class SplitDateTimeWidget:
|
||||
def decompress(
|
||||
self,
|
||||
value: Optional[datetime]
|
||||
) -> Union[List[None], List[Union[date, time]]]: ...
|
||||
) -> Union[List[Union[date, time]], List[None]]: ...
|
||||
|
||||
|
||||
class SplitHiddenDateTimeWidget:
|
||||
@@ -286,7 +286,7 @@ class SplitHiddenDateTimeWidget:
|
||||
|
||||
|
||||
class Textarea:
|
||||
def __init__(self, attrs: Optional[Union[Dict[str, str], Dict[str, int]]] = ...) -> None: ...
|
||||
def __init__(self, attrs: Optional[Union[Dict[str, int], Dict[str, str]]] = ...) -> None: ...
|
||||
|
||||
|
||||
class Widget:
|
||||
@@ -300,13 +300,13 @@ class Widget:
|
||||
) -> SafeText: ...
|
||||
def build_attrs(
|
||||
self,
|
||||
base_attrs: Dict[str, Union[str, int, float]],
|
||||
extra_attrs: Optional[Union[Dict[str, bool], Dict[str, Union[bool, str]], Dict[str, str]]] = ...
|
||||
) -> Dict[str, Union[str, int, float]]: ...
|
||||
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 format_value(self, value: Any) -> Optional[str]: ...
|
||||
def get_context(
|
||||
self,
|
||||
name: str,
|
||||
value: Any,
|
||||
attrs: Optional[Union[Dict[str, bool], Dict[str, Union[bool, str]], Dict[str, str]]]
|
||||
) -> Dict[str, Any]: ...
|
||||
attrs: Optional[Union[Dict[str, Union[bool, str]], Dict[str, bool], Dict[str, str]]]
|
||||
) -> Dict[str, Dict[str, Any]]: ...
|
||||
Reference in New Issue
Block a user