mirror of
https://github.com/django/django.git
synced 2025-09-26 12:09:19 +00:00
Changed newforms.CheckboxInput widget to return False as its value when not
include in the form (since HTML form submission doesn't send unselected check boxes). Patch from SmileyChris. Refs #5104. git-svn-id: http://code.djangoproject.com/svn/django/trunk@6563 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
22ee68961a
commit
e38d54e19a
2 changed files with 13 additions and 0 deletions
|
@ -276,6 +276,12 @@ u'<input type="checkbox" name="greeting" />'
|
|||
>>> w.render('greeting', None)
|
||||
u'<input type="checkbox" name="greeting" />'
|
||||
|
||||
The CheckboxInput widget will return False if the key is not found in the data
|
||||
dictionary (because HTML form submission doesn't send any result for unchecked
|
||||
checkboxes).
|
||||
>>> w.value_from_datadict({}, {}, 'testing')
|
||||
False
|
||||
|
||||
# Select Widget ###############################################################
|
||||
|
||||
>>> w = Select()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue