mirror of
https://github.com/davidhalter/django-stubs.git
synced 2026-01-03 01:53:25 +08:00
Fix type of min_value and max_value on DecimalField (#951)
* Fix type of min_value and max_value on DecimalField These should at the very least allow Decimals. Technically you can send in anything that's comparable to a Decimal, but I'm not sure if it makes sense to allow floats. Could allow both ints and Decimals I guess? * Allow ints and floats as well * Update django-stubs/forms/fields.pyi * Update django-stubs/forms/fields.pyi Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
This commit is contained in:
@@ -125,8 +125,8 @@ class DecimalField(IntegerField):
|
||||
def __init__(
|
||||
self,
|
||||
*,
|
||||
max_value: Optional[int] = ...,
|
||||
min_value: Optional[int] = ...,
|
||||
max_value: Union[Decimal, int, float, None] = ...,
|
||||
min_value: Union[Decimal, int, float, None] = ...,
|
||||
max_digits: Optional[int] = ...,
|
||||
decimal_places: Optional[int] = ...,
|
||||
required: bool = ...,
|
||||
|
||||
Reference in New Issue
Block a user