newforms BooleanField should be more tolerant of different inputs
|Reported by:||Simon Willison||Owned by:||Andrew Gibson|
|Cc:||Triage Stage:||Design decision needed|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||yes|
Here's how BooleanField works at the moment:
if value == 'False': return False return bool(value)
It would be really nice if it had a slightly more human-friendly idea of what constituted true and false values. For example, '1' v.s. '0', 'true' v.s. 'false', 'yes' v.s. 'no' etc. At the moment it assumes it will only be called from a check box widget, but there are times when this code will be used for input that didn't come from an HTML form.