Ticket #15497: extjs_checkboxes.diff
File extjs_checkboxes.diff, 887 bytes (added by , 14 years ago) |
---|
-
django/db/models/fields/__init__.py
504 504 505 505 def to_python(self, value): 506 506 if value in (True, False): 507 # if value is 1 or 0 th an it's equal to True or False, but we want507 # if value is 1 or 0 then it's equal to True or False, but we want 508 508 # to return a true bool for semantic reasons. 509 509 return bool(value) 510 if value in ('t', 'True', '1' ):510 if value in ('t', 'True', '1', 'on'): 511 511 return True 512 if value in ('f', 'False', '0' ):512 if value in ('f', 'False', '0', 'off'): 513 513 return False 514 514 raise exceptions.ValidationError(self.error_messages['invalid'])