#3289: MultipleHiddenInput widget is missing "value_from_datadict" method.
-----------------------------+----------------------------------------------
Reporter: anonymous | Owner: adrian
Type: defect | Status: new
Priority: low | Milestone:
Component: django.newforms | Version: SVN
Severity: minor | Keywords:
-----------------------------+----------------------------------------------
I have a custom field that handles multiple hidden integers. The field
value is a list of integers.
Example:
{{{
>>> class DaForm(forms.Form):
... values = MultipleHiddenIntegerField() # My custom field. Custom
"clean" method and "widget = forms.MultipleHiddenInput".
>>> form = DaForm(initial={'values': [1, 2, 3]})
>>> print form
<input type="hidden" name="values" value="1" id="id_values" />
<input type="hidden" name="values" value="2" id="id_values" />
<input type="hidden" name="values" value="3" id="id_values" />
>>> data = MultiValueDict()
>>> data.setlist('values', ['1', '2', '3'])
>>> form = DaForm(data)
>>> print form
<input type="hidden" name="values" value="3" id="id_values" />
}}}
As you can see, the last form does not print all inputs.
I have tracked this problem to the 'value_from_datadict' method. The class
'SelectMultiple' has a version that works perfectly.
The 'MultipleHiddenInput' widget needs this method.
--
Ticket URL: <http://code.djangoproject.com/ticket/3289>
Django <http://code.djangoproject.org/>
The web framework for perfectionists with deadlines.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---