Files
django-stubs/django-stubs/forms/boundfield.pyi
2018-07-29 23:34:58 +03:00

86 lines
2.7 KiB
Python

# 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
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): ...
def subwidgets(self) -> List[BoundWidget]: ...
def __bool__(self): ...
def __iter__(self): ...
def __len__(self) -> int: ...
def __getitem__(
self, idx: Union[slice, str, int]
) -> Union[List[BoundWidget], BoundWidget]: ...
@property
def errors(self) -> ErrorList: ...
def as_widget(
self,
widget: Optional[Union[HiddenInput, SplitHiddenDateTimeWidget]] = ...,
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[SafeText] = ...,
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): ...
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 = ...
def __init__(
self, parent_widget: ChoiceWidget, data: Dict[str, Any], 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): ...
@property
def choice_label(self) -> str: ...