From 104012b817ef6e07bf5b4686b2c48a617b20a44a Mon Sep 17 00:00:00 2001 From: Ethan Corey Date: Tue, 22 Feb 2022 14:47:43 -0500 Subject: [PATCH] Added `widget_type` annotation to `BoundField` (#855) * Add widget_type annotation to BoundField See https://github.com/django/django/blob/main/django/forms/boundfield.py#L283 * Tweaked annotation to be `AnyStr`, not `str` * Reverted to use `str` as return type --- django-stubs/forms/boundfield.pyi | 2 ++ 1 file changed, 2 insertions(+) diff --git a/django-stubs/forms/boundfield.pyi b/django-stubs/forms/boundfield.pyi index 6297b26..33e3596 100644 --- a/django-stubs/forms/boundfield.pyi +++ b/django-stubs/forms/boundfield.pyi @@ -47,6 +47,8 @@ class BoundField: def build_widget_attrs( self, attrs: Dict[str, str], widget: Optional[Widget] = ... ) -> Dict[str, Union[bool, str]]: ... + @property + def widget_type(self) -> str: ... class BoundWidget: parent_widget: Widget = ...