#32559: Add attribute 'step' to FloatField.
-------------------------------------+-------------------------------------
Reporter: Jacob Rief | Owner: Kapil
| Bansal
Type: New feature | Status: assigned
Component: Forms | Version: dev
Severity: Normal | Resolution:
Keywords: FloatField, | Triage Stage: Accepted
NumberInput, step |
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Kapil Bansal):
* needs_tests: 1 => 0
Old description:
> If someone wants to use the `step` attribute as provided by the HTML
> field
> `<input type="number" ...>` , she/he has to specify that using for
> instance
> `FloatField(widget=NumberInput(attrs={'step': 0.5}))`.
>
> Since the HTML standard offers a `step` attribute on input fields of
> `type="number"`,
> this feature shall be reflected by Django's `FloatField` and optionally
> `DecimalField`,
> rather than having to parametrize the widget.
>
> Min- and max-values are already supported by the `FloatField`, so the
> step-value
> would make sense here as well. It furthermore would require to revalidate
> the
> step-value by Django's Form validation, rather than by HTML alone.
New description:
If someone wants to use the `step` attribute as provided by the HTML field
`<input type="number" ...>` , she/he has to specify that using for
instance
`FloatField(widget=NumberInput(attrs={'step': 0.5}))`.
Since the HTML standard offers a `step` attribute on input fields of
`type="number"`,
this feature shall be reflected by Django's `FloatField` and optionally
`DecimalField`,
rather than having to parametrize the widget.
Min- and max-values are already supported by the `FloatField`, so the
step-value
would make sense here as well. It furthermore would require to revalidate
the
step-value by Django's Form validation, rather than by HTML alone.
Patch: https://github.com/django/django/pull/14162
--
--
Ticket URL: <https://code.djangoproject.com/ticket/32559#comment:8>
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 view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/063.678ac598ebfa16b9025bf9d77daf675e%40djangoproject.com.