Modified to_python method for BooleanField so that the to_python(str(bool_val)) round trip works. This was causing problems with the serializers.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@3371 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Russell Keith-Magee 2006-07-19 04:17:24 +00:00
parent e6e663371b
commit 59bf8dd310
1 changed files with 2 additions and 2 deletions

View File

@ -364,8 +364,8 @@ class BooleanField(Field):
def to_python(self, value):
if value in (True, False): return value
if value is 't': return True
if value is 'f': return False
if value is 't' or value is 'True': return True
if value is 'f' or value is 'False': return False
raise validators.ValidationError, gettext("This value must be either True or False.")
def get_manipulator_field_objs(self):