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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user