mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-08 04:54:48 +08:00
61 lines
1.9 KiB
Python
61 lines
1.9 KiB
Python
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,
|
|
)
|
|
|
|
|
|
class BaseForm:
|
|
def __getitem__(self, name: str) -> BoundField: ...
|
|
def __init__(
|
|
self,
|
|
data: Any = ...,
|
|
files: Optional[Union[Dict[str, SimpleUploadedFile], MultiValueDict]] = ...,
|
|
auto_id: Optional[Union[str, bool]] = ...,
|
|
prefix: Optional[str] = ...,
|
|
initial: Any = ...,
|
|
error_class: Type[ErrorList] = ...,
|
|
label_suffix: None = ...,
|
|
empty_permitted: bool = ...,
|
|
field_order: None = ...,
|
|
use_required_attribute: Optional[bool] = ...,
|
|
renderer: object = ...
|
|
) -> None: ...
|
|
def __iter__(self) -> Iterator[BoundField]: ...
|
|
def __repr__(self) -> str: ...
|
|
def _clean_fields(self) -> None: ...
|
|
def _clean_form(self) -> None: ...
|
|
def _html_output(
|
|
self,
|
|
normal_row: str,
|
|
error_row: str,
|
|
row_ender: str,
|
|
help_text_html: str,
|
|
errors_on_separate_row: bool
|
|
) -> SafeText: ...
|
|
def _post_clean(self) -> None: ...
|
|
def add_error(self, field: Optional[str], error: Union[str, ValidationError]) -> None: ...
|
|
def add_initial_prefix(self, field_name: str) -> str: ...
|
|
def add_prefix(self, field_name: str) -> str: ...
|
|
def as_p(self) -> SafeText: ...
|
|
def as_table(self) -> SafeText: ...
|
|
def as_ul(self) -> SafeText: ...
|
|
@cached_property
|
|
def changed_data(self) -> List[str]: ...
|
|
def clean(self) -> Dict[str, Any]: ...
|
|
@property
|
|
def errors(self) -> ErrorDict: ...
|
|
def full_clean(self) -> None: ... |