django-rest-framework/rest_framework/utils
Kevin Brown e888fc11c7
Merge NullBooleanField with BooleanField(allow_null=True) (#7122)
* Make `NullBooleanField` subclass `BooleanField`

This removes a lot of the redundancy that was in place becuase we
were not doing this. This maintains the `None` initial value that
was previously present, as well as disallowing `allow_null` to be
passed in.

* Remove special case for mapping `NullBooleanField`

In newer versions of Django, the `NullBooleanField` is handled the
same way as a `BooleanField(null=True)`. Given that we also support
that combination, and that our own `NullBooleanField` behaves in the
same manner, it makes sense to remove the special casing that exists
for it.

* Add test for BooleanField(null=True, choices)

* Remove special case for NullBooleanField

* Adjust mapping tests for NullBooleanField

* Fixed linting error

* Raise deprecation warning when NullBooleanField is used

* Fix linting issue in imports
2020-05-13 14:59:04 +01:00
..
__init__.py XML cleanup 2013-02-22 19:46:47 +00:00
breadcrumbs.py Dropped Python 2 compatibility. (#6615) 2019-04-30 17:53:44 +02:00
encoders.py replace force_text with force_str 2019-08-07 21:05:24 +02:00
field_mapping.py Merge NullBooleanField with BooleanField(allow_null=True) (#7122) 2020-05-13 14:59:04 +01:00
formatting.py replace force_text with force_str 2019-08-07 21:05:24 +02:00
html.py Ensure that html forms (multipart form data) respect optional fields (#5927) 2018-04-20 15:11:52 +02:00
humanize_datetime.py Change ISO 8601 date format to exclude year/month (#5936) 2018-04-14 05:23:31 +01:00
json.py Dropped Python 2 compatibility. (#6615) 2019-04-30 17:53:44 +02:00
mediatypes.py Dropped Python 2 compatibility. (#6615) 2019-04-30 17:53:44 +02:00
model_meta.py Remove references to unsupported Django versions in docs and code (#5602) 2017-11-20 09:35:54 +01:00
representation.py replace force_text with force_str 2019-08-07 21:05:24 +02:00
serializer_helpers.py replace force_text with force_str 2019-08-07 21:05:24 +02:00
urls.py Dropped Python 2 compatibility. (#6615) 2019-04-30 17:53:44 +02:00