summaryrefslogtreecommitdiff
path: root/docs/ref/models
diff options
context:
space:
mode:
Diffstat (limited to 'docs/ref/models')
-rw-r--r--docs/ref/models/class.txt17
-rw-r--r--docs/ref/models/instances.txt6
2 files changed, 23 insertions, 0 deletions
diff --git a/docs/ref/models/class.txt b/docs/ref/models/class.txt
index c0ccb6caff..4890955fe7 100644
--- a/docs/ref/models/class.txt
+++ b/docs/ref/models/class.txt
@@ -39,6 +39,23 @@ Attributes
The exception is a subclass of
:exc:`django.core.exceptions.MultipleObjectsReturned`.
+``NotUpdated``
+--------------
+
+.. versionadded:: 6.0
+
+.. exception:: Model.NotUpdated
+
+ This exception is raised when :ref:`a forced update
+ <ref-models-force-insert>` of a :class:`~django.db.models.Model` instance
+ does not affect any rows.
+
+ Django provides a ``NotUpdated`` exception as an attribute of each model
+ class to identify the class of object that could not be updated, allowing
+ you to catch exceptions for a particular model class. The exception is a
+ subclass of :exc:`django.core.exceptions.ObjectNotUpdated` and inherits
+ from :exc:`django.db.DatabaseError` for backward compatibility reasons.
+
``objects``
-----------
diff --git a/docs/ref/models/instances.txt b/docs/ref/models/instances.txt
index be4ad4a4f4..e15e1c93bf 100644
--- a/docs/ref/models/instances.txt
+++ b/docs/ref/models/instances.txt
@@ -601,6 +601,12 @@ You can pass ``force_insert=(models.Model,)`` to force an ``INSERT`` statement
for all parents. By default, ``force_insert=True`` only forces the insertion of
a new row for the current model.
+.. versionchanged:: 6.0
+
+ When a forced update does not affect any rows a
+ :exc:`~django.db.models.Model.NotUpdated` exception is raised. On previous
+ versions a generic :exc:`django.db.DatabaseError` was raised.
+
It should be very rare that you'll need to use these parameters. Django will
almost always do the right thing and trying to override that will lead to
errors that are difficult to track down. This feature is for advanced use