mirror of
https://github.com/davidhalter/django-stubs.git
synced 2026-05-04 12:35:49 +08:00
Allow Field.widget to be a class or instance (#426)
According to source below, a Field's widget is allowed to be a class or instance of Widget. https://github.com/django/django/blob/156a2138db20abc89933121e4ff2ee2ce56a173a/django/forms/fields.py#L63-L66
This commit is contained in:
@@ -14,7 +14,7 @@ class Field:
|
||||
initial: Any
|
||||
label: Optional[str]
|
||||
required: bool
|
||||
widget: Type[Widget] = ...
|
||||
widget: Union[Type[Widget], Widget] = ...
|
||||
hidden_widget: Any = ...
|
||||
default_validators: Any = ...
|
||||
default_error_messages: Any = ...
|
||||
|
||||
Reference in New Issue
Block a user