diff --git a/django-stubs/forms/forms.pyi b/django-stubs/forms/forms.pyi index dcb140c6c..ff0838043 100644 --- a/django-stubs/forms/forms.pyi +++ b/django-stubs/forms/forms.pyi @@ -15,8 +15,8 @@ class DeclarativeFieldsMetaclass(MediaDefiningClass): ... class BaseForm: class Meta: fields: Sequence[str] = ... - default_renderer: Any = ... - field_order: Any = ... + default_renderer: Union[None, BaseRenderer, type[BaseRenderer]] = ... + field_order: Optional[Sequence[str]] = ... use_required_attribute: bool = ... is_bound: bool = ... data: Dict[str, Any] = ... @@ -29,7 +29,7 @@ class BaseForm: empty_permitted: bool = ... fields: Dict[str, Any] = ... renderer: BaseRenderer = ... - cleaned_data: Any = ... + cleaned_data: Mapping[str, Any] = ... def __init__( self, data: Optional[Mapping[str, Any]] = ..., @@ -59,15 +59,15 @@ class BaseForm: def add_error(self, field: Optional[str], error: Union[ValidationError, str]) -> None: ... def has_error(self, field: Any, code: Optional[Any] = ...): ... def full_clean(self) -> None: ... - def clean(self) -> Dict[str, Any]: ... + def clean(self) -> Optional[Mapping[str, Any]]: ... def has_changed(self) -> bool: ... @property def changed_data(self) -> List[str]: ... @property def media(self) -> Media: ... - def is_multipart(self): ... - def hidden_fields(self): ... - def visible_fields(self): ... + def is_multipart(self) -> bool: ... + def hidden_fields(self) -> List[BoundField]: ... + def visible_fields(self) -> List[BoundField]: ... def get_initial_for_field(self, field: Field, field_name: str) -> Any: ... def _html_output( self,