Merge pull request #5038 from htmis/master

Update Boolean field to support 'yes' and 'no' values
This commit is contained in:
Tom Christie 2017-03-30 08:58:00 +01:00 committed by GitHub
commit fe33b2d0b6

View File

@ -649,6 +649,7 @@ class BooleanField(Field):
initial = False initial = False
TRUE_VALUES = { TRUE_VALUES = {
't', 'T', 't', 'T',
'y', 'Y', 'yes', 'YES',
'true', 'True', 'TRUE', 'true', 'True', 'TRUE',
'on', 'On', 'ON', 'on', 'On', 'ON',
'1', 1, '1', 1,
@ -656,6 +657,7 @@ class BooleanField(Field):
} }
FALSE_VALUES = { FALSE_VALUES = {
'f', 'F', 'f', 'F',
'n', 'N', 'no', 'NO',
'false', 'False', 'FALSE', 'false', 'False', 'FALSE',
'off', 'Off', 'OFF', 'off', 'Off', 'OFF',
'0', 0, 0.0, '0', 0, 0.0,