Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds 'true' and 'false' to NullBooleanField. #3000

Closed
wants to merge 1 commit into from

Conversation

wlonk
Copy link
Contributor

@wlonk wlonk commented Jul 29, 2014

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.

Related to ticket 23129

@charettes
Copy link
Member

Please review the contributing guidelines and change your commit message accordingly.

submit for True and False, for 'true' and 'false', which are likely to be returned by
JavaScript serializations of forms, and for '1' and '0', which is what a RadioField will
submit. Unlike the Booleanfield we need to explicitly check for True, because we are not
using the bool() function
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason why this was enlarged?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope, just fat-fingered my line wrapping.

@wlonk
Copy link
Contributor Author

wlonk commented Jul 29, 2014

Thanks, I will do so as soon as I'm back at a computer!
On Jul 29, 2014 11:28 AM, "Simon Charette" notifications@github.com wrote:

Please review the contributing guidelines and change your commit message
accordingly
https://docs.djangoproject.com/en/dev/internals/contributing/committing-code/#committing-guidelines
.


Reply to this email directly or view it on GitHub
#3000 (comment).

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.
@timgraham
Copy link
Member

buildbot, test this please.

@timgraham
Copy link
Member

merged in 17e75d0, thanks.

@timgraham timgraham closed this Jul 29, 2014
@wlonk wlonk deleted the tweak_null_boolean_field branch August 2, 2014 19:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants