[Django] #21752: forms.NumberInput - "step" always forced to "any", cannot modify

50 views
Skip to first unread message

Django

unread,
Jan 8, 2014, 4:35:28 PM1/8/14
to django-...@googlegroups.com
#21752: forms.NumberInput - "step" always forced to "any", cannot modify
----------------------------+--------------------
Reporter: orcein@… | Owner: nobody
Type: Bug | Status: new
Component: Forms | Version: 1.6
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
----------------------------+--------------------
I'm trying to customize my form widgets, and I have the following code:
{{{
rand_range = forms.NumberInput(attrs={'step': 0.01, 'max': 1.0, 'min':
0.0})
}}}
However when the field is rendered in HTML, the step is always set to
"any". I have also tried putting the number in quotes to no perceivable
result. "min" and "max" values are working correctly.

--
Ticket URL: <https://code.djangoproject.com/ticket/21752>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Jan 8, 2014, 6:31:42 PM1/8/14
to django-...@googlegroups.com
#21752: forms.NumberInput - "step" always forced to "any", cannot modify
--------------------------+--------------------------------------

Reporter: orcein@… | Owner: nobody
Type: Bug | Status: new
Component: Forms | Version: 1.6
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
--------------------------+--------------------------------------
Changes (by timo):

* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0


Comment:

Could you write a test for Django's test suite that demonstrates the
issue? There are some tests for step in forms_tests/tests/test_fields.py.

--
Ticket URL: <https://code.djangoproject.com/ticket/21752#comment:1>

Django

unread,
Jan 9, 2014, 3:53:40 AM1/9/14
to django-...@googlegroups.com
#21752: forms.NumberInput - "step" always forced to "any", cannot modify
--------------------------+------------------------------------
Reporter: orcein@… | Owner: claudep
Type: Bug | Status: assigned
Component: Forms | Version: 1.6
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
--------------------------+------------------------------------
Changes (by claudep):

* owner: nobody => claudep
* status: new => assigned
* stage: Unreviewed => Accepted


Comment:

I can confirm. I'll investigate this issue.

--
Ticket URL: <https://code.djangoproject.com/ticket/21752#comment:2>

Django

unread,
Jan 9, 2014, 4:28:52 AM1/9/14
to django-...@googlegroups.com
#21752: forms.NumberInput - "step" always forced to "any", cannot modify
--------------------------+------------------------------------
Reporter: orcein@… | Owner: claudep
Type: Bug | Status: assigned
Component: Forms | Version: 1.6

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
--------------------------+------------------------------------
Changes (by claudep):

* has_patch: 0 => 1


Comment:

Here's the most straightforward way to fix this issue.

--
Ticket URL: <https://code.djangoproject.com/ticket/21752#comment:3>

Django

unread,
Jan 11, 2014, 8:08:48 AM1/11/14
to django-...@googlegroups.com
#21752: forms.NumberInput - "step" always forced to "any", cannot modify
--------------------------+------------------------------------
Reporter: orcein@… | Owner: claudep
Type: Bug | Status: closed
Component: Forms | Version: 1.6
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
--------------------------+------------------------------------
Changes (by Claude Paroz <claude@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"18374c1d8c37dd251dae72470b6c532bddf140eb"]:
{{{
#!CommitTicketReference repository=""
revision="18374c1d8c37dd251dae72470b6c532bddf140eb"
Fixed #21752 -- Prevented custom widget step attribute to be overwritten

Thanks orcein at gmail.com for the report.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/21752#comment:4>

Reply all
Reply to author
Forward
0 new messages