Opened 2 years ago

Closed 2 years ago

#23129 closed New feature (fixed)

NullBooleanField to accept lower-case string representations of booleans

Reported by: wlonk Owned by: David Hoffman
Component: Forms Version: master
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

JavaScript serializations of forms will sometimes render the boolean values as the strings 'true' and 'false', in lower case. Rather than repeat boilerplate in the JavaScript to circumvent this, it seems reasonable to allow Django to understand the lower-case versions of the booleans.

(If there are reasons this hasn't been done, I apologize; I was unable to find any earlier reference to this.)

Change History (4)

comment:1 Changed 2 years ago by Simon Charette

Component: UncategorizedForms
Triage Stage: UnreviewedAccepted

comment:2 Changed 2 years ago by anonymous

Owner: changed from nobody to anonymous
Status: newassigned

comment:3 Changed 2 years ago by David Hoffman

Owner: changed from anonymous to David Hoffman

comment:4 Changed 2 years ago by Tim Graham <timograham@…>

Resolution: fixed
Status: assignedclosed

In 17e75d03f92cff7d1d5d4679a8a09b13e08f3264:

Fixed #23129 -- Added 'true' and 'false' to NullBooleanField.

JavaScript serializations of forms will sometimes render the boolean
values as the strings 'true' and 'false', in lower case. Rather than
repeat boilerplate in the JavaScript to circumvent this, it seems
reasonable to allow Django to understand the lower-case versions of the
booleans.

Note: See TracTickets for help on using tickets.
Back to Top