-
-
Notifications
You must be signed in to change notification settings - Fork 31.6k
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
Refs #23130 -- Allowed BooleanField to be null=True #9016
Conversation
… blank-booleanfield
This reverts commit 9ef5360.
✔️ tests passing
Implemented that fix! But also I feel this becomes less relevant if #9018 is merged first
So ^ is the last thing to do Although I'm not sure to what extent adding those tests would be overkill, since class NullBooleanField(BooleanField):
"""
A BooleanField that forces an optional NullBooleanSelect widget
"""
def __init__(self, **kwargs):
super().__init__(null=True, **kwargs) |
|
✔️
✔️
WIP. I added the
|
In case I forget to make them, some optimization ticket ideas spawned from this PR are:
|
…ield includes merge resolution for - django@d13a9e4 - in django#9451 - for https://code.djangoproject.com/ticket/28909 the _check_null simplification is no longer needed, as null is allowed on BooleanField now Old conflicts: - django/db/models/fields/__init__.py
I incorporated some of these updates in #8467 which should be ready for review now. Thanks! |
https://code.djangoproject.com/ticket/23130
Picks up were @timgraham left off in #8467
refs:
details:
BooleanField
model field can takenull=True
NullBooleanField
is now justBooleanField(null=True)
NullBooleanField
(this decision was made in @timgraham's PR)normalizes boolean type casting, and incorporatesdistutils.util.strtobool
collects all the different boolean casting special cases into a single filedjango/utils/typecasting.py
still TODO:
typecasting.py
changeNullBooleanField
isinstance calls to turn intonull=True
typecasting.py
entrypoint functions need better namesevaluatetypecasting.py
nullable=[ True | False ]
handlingadd a few more cases totest_typecasting.py