Ticket #7190: boolfield.diff

File boolfield.diff, 945 bytes (added by Jeffrey Froman <django.tcijf@…>, 7 years ago)

patch for django/db/models/fields/init.py

Line 
1*** django/db/models/fields/__init__.py 2008-04-28 04:02:14.000000000 -0700
2--- django/db/models/fields/__init__fixed.py    2008-05-07 16:04:58.000000000 -0700
3***************
4*** 481,489 ****
5          return "BooleanField"
6 
7      def to_python(self, value):
8          if value in (True, False): return value
9-         if value in ('t', 'True', '1'): return True
10-         if value in ('f', 'False', '0'): return False
11          raise validators.ValidationError, _("This value must be either True or False.")
12 
13      def get_manipulator_field_objs(self):
14--- 481,489 ----
15          return "BooleanField"
16 
17      def to_python(self, value):
18+         if value in ('t', 'True', '1', 1): return True
19+         if value in ('f', 'False', '0', 0): return False
20          if value in (True, False): return value
21          raise validators.ValidationError, _("This value must be either True or False.")
22 
23      def get_manipulator_field_objs(self):
Back to Top