Opened 8 months ago

Closed 8 months ago

#23129 closed New feature (fixed)

NullBooleanField to accept lower-case string representations of booleans

Reported by: wlonk Owned by: dhoffman
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 8 months ago by charettes

  • Component changed from Uncategorized to Forms
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

comment:2 Changed 8 months ago by anonymous

  • Owner changed from nobody to anonymous
  • Status changed from new to assigned

comment:3 Changed 8 months ago by dhoffman

  • Owner changed from anonymous to dhoffman

comment:4 Changed 8 months ago by Tim Graham <timograham@…>

  • Resolution set to fixed
  • Status changed from assigned to closed

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