Merge pull request #474 from justanotherbody/master

Add support for "true" and "false" as BooleanField values
This commit is contained in:
Tom Christie 2012-12-06 14:36:49 -08:00
commit bd530a2ee4

View File

@ -693,9 +693,9 @@ class BooleanField(WritableField):
default = False
def from_native(self, value):
if value in ('t', 'True', '1'):
if value in ('true', 't', 'True', '1'):
return True
if value in ('f', 'False', '0'):
if value in ('false', 'f', 'False', '0'):
return False
return bool(value)