﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
20982	forms.BooleanField field issue	george.li	nobody	"in django 1.4 1.5.1


{{{
from django import forms
forms.BooleanField().clean(True)
}}}
this case is success


But
{{{
forms.BooleanField().clean(False)
}}}

{{{
forms.BooleanField().clean('false')
}}}

in this two case are 
*** ValidationError: [u'This field is required.']


source code
{{{
 621 class BooleanField(Field):
 622     widget = CheckboxInput
 623
 624     def to_python(self, value):
 625     ¦   """"""Returns a Python boolean object.""""""
 626     ¦   # Explicitly check for the string 'False', which is what a hidden field
 627     ¦   # will submit for False. Also check for '0', since this is what
 628     ¦   # RadioSelect will provide. Because bool(""True"") == bool('1') == True,
 629     ¦   # we don't need to handle that explicitly.
 630     ¦   if isinstance(value, six.string_types) and value.lower() in ('false', '0'):
 631     ¦   ¦   value = False
 632     ¦   else:
 633     ¦   ¦   value = bool(value)
 634     ¦   value = super(BooleanField, self).to_python(value)
 635     ¦   if not value and self.required:
 636     ¦   ¦   raise ValidationError(self.error_messages['required'])
 637     ¦   return value
}}}

in 630, 'false' and '0' Transform to boolean False
but 635 then decide False is no input value
"	Uncategorized	new	Forms	1.5	Normal				Unreviewed	0	0	0	0	0	0
