mirror of
https://github.com/django/django.git
synced 2025-11-20 03:30:00 +00:00
Fixed #5959 -- Fixed handling of False values in hidden boolean fields. Thanks,
SmileyChris. git-svn-id: http://code.djangoproject.com/svn/django/trunk@6745 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
4cbc8c62cf
commit
7a166f1a1c
3 changed files with 22 additions and 4 deletions
|
|
@ -914,6 +914,11 @@ False
|
|||
>>> f.clean('Django rocks')
|
||||
True
|
||||
|
||||
>>> f.clean('True')
|
||||
True
|
||||
>>> f.clean('False')
|
||||
False
|
||||
|
||||
>>> f = BooleanField(required=False)
|
||||
>>> f.clean('')
|
||||
False
|
||||
|
|
@ -930,6 +935,11 @@ False
|
|||
>>> f.clean('Django rocks')
|
||||
True
|
||||
|
||||
A form's BooleanField with a hidden widget will output the string 'False', so
|
||||
that should clean to the boolean value False:
|
||||
>>> f.clean('False')
|
||||
False
|
||||
|
||||
# ChoiceField #################################################################
|
||||
|
||||
>>> f = ChoiceField(choices=[('1', '1'), ('2', '2')])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue