Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions docs/ref/models/fields.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1720,8 +1720,9 @@ The possible values for :attr:`~ForeignKey.on_delete` are found in

* .. attribute:: CASCADE

Cascade deletes. Django emulates the behavior of the SQL constraint ON
DELETE CASCADE and also deletes the object containing the ForeignKey.
Cascade deletes. Django emulates the behavior of the SQL constraint ``ON
DELETE CASCADE`` and also deletes the object containing the
:class:`ForeignKey`.

:meth:`.Model.delete` isn't called on related models, but the
:data:`~django.db.models.signals.pre_delete` and
Expand Down Expand Up @@ -1940,9 +1941,9 @@ The possible values for :attr:`~ForeignKey.on_delete` are found in

Setting it to ``False`` does not mean you can reference a swappable model
even if it is swapped out - ``False`` means that the migrations made
with this ForeignKey will always reference the exact model you specify
(so it will fail hard if the user tries to run with a User model you don't
support, for example).
with this :class:`ForeignKey` will always reference the exact model you
specify (so it will fail hard if the user tries to run with a ``User``
model you don't support, for example).

If in doubt, leave it to its default of ``True``.

Expand Down