From 640553dcd7d5bb61234409fb79904ee0ea9f857a Mon Sep 17 00:00:00 2001 From: Chris Beaven Date: Wed, 27 Oct 2021 00:34:08 +1300 Subject: [PATCH] Fix boundfield method parameters (#741) --- django-stubs/forms/boundfield.pyi | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/django-stubs/forms/boundfield.pyi b/django-stubs/forms/boundfield.pyi index ae293b5..6297b26 100644 --- a/django-stubs/forms/boundfield.pyi +++ b/django-stubs/forms/boundfield.pyi @@ -1,4 +1,4 @@ -from typing import Any, Dict, List, Optional, Union +from typing import Any, Dict, Iterable, List, Optional, Union from django.forms.fields import Field from django.forms.forms import BaseForm @@ -25,17 +25,19 @@ class BoundField: 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: ... + def as_widget( + self, widget: Optional[Widget] = ..., attrs: Optional[Dict[str, str]] = ..., only_initial: bool = ... + ) -> SafeText: ... + def as_text(self, attrs: Optional[Dict[str, str]] = ..., **kwargs: Any) -> SafeText: ... + def as_textarea(self, attrs: Optional[Dict[str, str]] = ..., **kwargs: Any) -> SafeText: ... + def as_hidden(self, attrs: Optional[Dict[str, str]] = ..., **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: ... + def css_classes(self, extra_classes: Union[str, Iterable[str], None] = ...) -> str: ... @property def is_hidden(self) -> bool: ... @property