add support for Yes/No literals with BooleanField (#7701)

This commit is contained in:
kuter 2021-03-09 11:17:30 +01:00 committed by GitHub
parent b463878132
commit e9a54e38e1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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