Opened 10 years ago

Closed 10 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: dev
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 by Simon Charette, 10 years ago

Component: UncategorizedForms
Triage Stage: UnreviewedAccepted

comment:2 by anonymous, 10 years ago

Owner: changed from nobody to anonymous
Status: newassigned

comment:3 by David Hoffman, 10 years ago

Owner: changed from anonymous to David Hoffman

comment:4 by Tim Graham <timograham@…>, 10 years ago

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