Skip to content

Commit

Permalink
Allow float for min_value and max_value of FloatField (#1081)
Browse files Browse the repository at this point in the history
Co-authored-by: Thibaut <[email protected]>
  • Loading branch information
UnknownPlatypus and Thibaut authored Aug 1, 2022
1 parent 41804f0 commit 9664729
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions django-stubs/forms/fields.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,23 @@ class IntegerField(Field):
def widget_attrs(self, widget: Widget) -> Dict[str, Any]: ...

class FloatField(IntegerField):
def __init__(
self,
*,
max_value: Union[int, float, None] = ...,
min_value: Union[int, float, None] = ...,
required: bool = ...,
widget: Optional[Union[Widget, Type[Widget]]] = ...,
label: Optional[str] = ...,
initial: Optional[Any] = ...,
help_text: str = ...,
error_messages: Optional[_ErrorMessagesT] = ...,
show_hidden_initial: bool = ...,
validators: Sequence[_ValidatorCallable] = ...,
localize: bool = ...,
disabled: bool = ...,
label_suffix: Optional[str] = ...,
) -> None: ...
def to_python(self, value: Optional[Any]) -> Optional[float]: ... # type: ignore
def validate(self, value: float) -> None: ...
def widget_attrs(self, widget: Widget) -> Dict[str, Any]: ...
Expand Down

0 comments on commit 9664729

Please sign in to comment.