Added '1' and '0' as allowed text input for BooleanFields. This was required to acommodate XML serializers when using MySQL.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3844 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
83613ad6de
commit
83501405c2
|
@ -367,8 +367,8 @@ class BooleanField(Field):
|
|||
|
||||
def to_python(self, value):
|
||||
if value in (True, False): return value
|
||||
if value in ('t', 'True'): return True
|
||||
if value in ('f', 'False'): return False
|
||||
if value in ('t', 'True', '1'): return True
|
||||
if value in ('f', 'False', '0'): return False
|
||||
raise validators.ValidationError, gettext("This value must be either True or False.")
|
||||
|
||||
def get_manipulator_field_objs(self):
|
||||
|
|
Loading…
Reference in New Issue