Skip to content

Commit

Permalink
Added '1' and '0' as allowed text input for BooleanFields. This was r…
Browse files Browse the repository at this point in the history
…equired to acommodate XML serializers when using MySQL.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@3844 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information
freakboy3742 committed Sep 26, 2006
1 parent 83613ad commit 8350140
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions django/db/models/fields/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,8 +367,8 @@ def __init__(self, *args, **kwargs):

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):
Expand Down

0 comments on commit 8350140

Please sign in to comment.