#29285: forms.DecimalField doesn't recognise max_decimal_places kwarg
-------------------------------------+-------------------------------------
Reporter: Paul Korir | Owner: nobody
Type: Uncategorized | Status: new
Component: Documentation | Version: 2.0
Severity: Normal | Resolution:
Keywords: fields, | Triage Stage:
max_decimal_places | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Description changed by Claude Paroz:
Old description:
> Documentation
> (https://docs.djangoproject.com/en/2.0/ref/forms/fields/#decimalfield)
> states that max_decimal_places is a kwarg
>
> File "/Users/paulkorir/Documents/Code/Python/Django/project-
> classified/project_classified/listings/forms.py", line 48, in
> AdvancedSearch
> price_minimum = forms.DecimalField(required=False, min_value=0,
> max_value=2, max_decimal_places=2)
> File "/Users/paulkorir/miniconda3/envs/project_classified/lib/python3.6
> /site-packages/django/forms/fields.py", line 330, in __init__
> super().__init__(max_value=max_value, min_value=min_value, **kwargs)
> File "/Users/paulkorir/miniconda3/envs/project_classified/lib/python3.6
> /site-packages/django/forms/fields.py", line 254, in __init__
> super().__init__(**kwargs)
> TypeError: __init__() got an unexpected keyword argument
> 'max_decimal_places'
>
> However, works with decimal_places instead of max_decimal_places
New description:
Documentation
(https://docs.djangoproject.com/en/2.0/ref/forms/fields/#decimalfield)
states that max_decimal_places is a kwarg
{{{
File "/Users/paulkorir/Documents/Code/Python/Django/project-
classified/project_classified/listings/forms.py", line 48, in
AdvancedSearch
price_minimum = forms.DecimalField(required=False, min_value=0,
max_value=2, max_decimal_places=2)
File "/Users/paulkorir/miniconda3/envs/project_classified/lib/python3.6
/site-packages/django/forms/fields.py", line 330, in __init__
super().__init__(max_value=max_value, min_value=min_value, **kwargs)
File "/Users/paulkorir/miniconda3/envs/project_classified/lib/python3.6
/site-packages/django/forms/fields.py", line 254, in __init__
super().__init__(**kwargs)
TypeError: __init__() got an unexpected keyword argument
'max_decimal_places'
}}}
However, works with decimal_places instead of max_decimal_places
--
--
Ticket URL: <https://code.djangoproject.com/ticket/29285#comment:1>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/066.85135121fc113661d27bab338f06e404%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.