summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell Keith-Magee <russell@keith-magee.com>2006-07-19 04:17:24 +0000
committerRussell Keith-Magee <russell@keith-magee.com>2006-07-19 04:17:24 +0000
commit59bf8dd3108fc1124d0bd843f7146595a0b0228f (patch)
tree298f01c5498c01ea5951ee3c0f9522b3e70674e5
parente6e663371bda04751352bcba134b144cde21945a (diff)
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
-rw-r--r--django/db/models/fields/__init__.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/django/db/models/fields/__init__.py b/django/db/models/fields/__init__.py
index f99f555625..2a54f2010f 100644
--- a/django/db/models/fields/__init__.py
+++ b/django/db/models/fields/__init__.py
@@ -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):