mirror of https://github.com/django/django.git
Fixed #34242 -- Doc'd that primary key is set to None when deleting objects.
This commit is contained in:
parent
cc8aa6bf9c
commit
5cd1385356
|
@ -457,6 +457,9 @@ The primary key field is read-only. If you change the value of the primary
|
||||||
key on an existing object and then save it, a new object will be created
|
key on an existing object and then save it, a new object will be created
|
||||||
alongside the old one.
|
alongside the old one.
|
||||||
|
|
||||||
|
The primary key field is set to ``None`` when
|
||||||
|
:meth:`deleting <django.db.models.Model.delete>` an object.
|
||||||
|
|
||||||
``unique``
|
``unique``
|
||||||
----------
|
----------
|
||||||
|
|
||||||
|
|
|
@ -644,8 +644,9 @@ Deleting objects
|
||||||
|
|
||||||
Issues an SQL ``DELETE`` for the object. This only deletes the object in the
|
Issues an SQL ``DELETE`` for the object. This only deletes the object in the
|
||||||
database; the Python instance will still exist and will still have data in
|
database; the Python instance will still exist and will still have data in
|
||||||
its fields. This method returns the number of objects deleted and a dictionary
|
its fields, except for the primary key set to ``None``. This method returns the
|
||||||
with the number of deletions per object type.
|
number of objects deleted and a dictionary with the number of deletions per
|
||||||
|
object type.
|
||||||
|
|
||||||
For more details, including how to delete objects in bulk, see
|
For more details, including how to delete objects in bulk, see
|
||||||
:ref:`topics-db-queries-delete`.
|
:ref:`topics-db-queries-delete`.
|
||||||
|
|
Loading…
Reference in New Issue