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
Expand valid values for BooleanWidget #1071
Expand valid values for BooleanWidget #1071
Conversation
Deals better with NULL/None values, which are now (Django 2.2) permitted in the regular fields.BooleanField (fields.NullBooleanField has been deprecated). Importing a field with TRUE/FALSE/NULL was otherwise failing (and turning all the NULL's into FALSE's).
1e83e95
to
2fb0213
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @MinchinWeb for the PR! Do you mind adding some docs and tests for this change?
643ad97
to
212f557
Compare
@andrewgy8 : docs and tests added! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Is anything holding this up? |
@MinchinWeb There are some conflicts that need to be resolved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixes #1135
Thanks @MinchinWeb ! |
Ill try to have this in the next minor release asap. |
Deals better with NULL/None values, which are now (Django 2.2) permitted in the regular fields.BooleanField (fields.NullBooleanField has been deprecated). Importing a field with TRUE/FALSE/NULL was otherwise failing (via turning all the NULL's into FALSE's).
Problem
The Boolean widget (which is used to diff an re-import) wasn't dealing with Null/None/Empty values, and instead casting them as "0" (i.e.
False
)Solution
Explicitly add
""
(an empty string) andNone
as "None values".Acceptance Criteria
Have you written tests? Have you included screenshots of your changes if applicable?
Did you document your changes?
No additional tests. No screenshot. I've added it to the Changelog (under v2.0.2).