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
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
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
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