1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

Fixed #4136 -- Made ModelForm save empty values for nullable CharFields as NULL.

Previously, empty values were saved as strings.
This commit is contained in:
Jon Dufresne
2016-05-18 07:30:42 -07:00
committed by Tim Graham
parent f2c0eb19e9
commit 267dc4addd
9 changed files with 66 additions and 18 deletions

View File

@@ -154,7 +154,8 @@ File Uploads
Forms
~~~~~
* ...
* The new :attr:`CharField.empty_value <django.forms.CharField.empty_value>`
attribute allows specifying the Python value to use to represent "empty".
Generic Views
~~~~~~~~~~~~~
@@ -258,6 +259,13 @@ Miscellaneous
displays the related object's ID. Remove the ``_id`` suffix if you want the
old behavior of the string representation of the object.
* In model forms, :class:`~django.db.models.CharField` with ``null=True`` now
saves ``NULL`` for blank values instead of empty strings.
* On Oracle, :meth:`Model.validate_unique()
<django.db.models.Model.validate_unique>` no longer checks empty strings for
uniqueness as the database interprets the value as ``NULL``.
.. _deprecated-features-1.11:
Features deprecated in 1.11