#31369: Deprecate NullBooleanField
-------------------------------------+-------------------------------------
Reporter: David Smith | Owner: Hristiyan
Type: | Ivanov
Cleanup/optimization | Status: assigned
Component: Database layer | Version: 3.0
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Hristiyan Ivanov):
I had a quick look at the code myself and I think I understand the problem
you are raising. The behavior of the `BooleanField`s is indeed different,
which is due to `forms.BooleanField`'s `to_python()` method as it uses
`bool(value)` if the value is not False.
I do agree that if `models.NullBooleanField` is getting deprecated,
`forms.NullBooleanField` should also be deprecated and that just adding
the deprecation message will introduce work later on, as the
`forms.BooleanField` will need to be changed.
I will have a look at the widgets that the two form fields are using to
see if there is any substantial difference and if not, I guess we can
alter the `widgets.CheckboxInput` and also deprecate
`widgets.NullBooleanSelect`, as well as improve the `to_python()` method
of `forms.BooleanField` and therefor deprecate all three
`NullBooleanField` related items.
--
Ticket URL: <https://code.djangoproject.com/ticket/31369#comment:8>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/066.b1788501398c02b54bd4f9339a3e5cad%40djangoproject.com.