summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell Keith-Magee <russell@keith-magee.com>2006-09-26 00:36:04 +0000
committerRussell Keith-Magee <russell@keith-magee.com>2006-09-26 00:36:04 +0000
commit83501405c25b85abde529fa7e205a00100211e5c (patch)
tree20c2e9370b31c24a3548169a376b68e01e7b4903
parent83613ad6ded78d20404077452e46dea69888485b (diff)
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
-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 49eb594838..3314f8ded0 100644
--- a/django/db/models/fields/__init__.py
+++ b/django/db/models/fields/__init__.py
@@ -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):