mirror of
https://github.com/davidhalter/django-stubs.git
synced 2026-08-19 06:08:04 +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:
co-authored by
Nikita Sobolev
parent
1a36c6c379
commit
7d84e5473a
@@ -125,8 +125,8 @@ class DecimalField(IntegerField):
|
|||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
*,
|
*,
|
||||||
max_value: Optional[int] = ...,
|
max_value: Union[Decimal, int, float, None] = ...,
|
||||||
min_value: Optional[int] = ...,
|
min_value: Union[Decimal, int, float, None] = ...,
|
||||||
max_digits: Optional[int] = ...,
|
max_digits: Optional[int] = ...,
|
||||||
decimal_places: Optional[int] = ...,
|
decimal_places: Optional[int] = ...,
|
||||||
required: bool = ...,
|
required: bool = ...,
|
||||||
|
|||||||
Reference in New Issue
Block a user