mirror of
https://github.com/django/django.git
synced 2025-01-27 10:39:40 +00:00
Fixed #8658: Added cross-references to signals docs from Model.save() docs
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8755 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
6ba55eee30
commit
f2c80f93d9
@ -107,10 +107,10 @@ What happens when you save?
|
|||||||
|
|
||||||
When you save an object, Django performs the following steps:
|
When you save an object, Django performs the following steps:
|
||||||
|
|
||||||
1. **Emit a ``pre_save`` signal.** This provides a notification that
|
1. **Emit a pre-save signal.** The :ref:`signal <ref-signals>`
|
||||||
an object is about to be saved. You can register a listener that
|
:attr:`django.db.models.signals.pre_save` is sent, allowing any
|
||||||
will be invoked whenever this signal is emitted. (These signals are
|
functions listening for that signal to take some customized
|
||||||
not yet documented.)
|
action.
|
||||||
|
|
||||||
2. **Pre-process the data.** Each field on the object is asked to
|
2. **Pre-process the data.** Each field on the object is asked to
|
||||||
perform any automated data modification that the field may need
|
perform any automated data modification that the field may need
|
||||||
@ -140,9 +140,10 @@ When you save an object, Django performs the following steps:
|
|||||||
data is then composed into an SQL statement for insertion into the
|
data is then composed into an SQL statement for insertion into the
|
||||||
database.
|
database.
|
||||||
|
|
||||||
5. **Emit a ``post_save`` signal.** As with the ``pre_save`` signal, this
|
5. **Emit a post-save signal.** The signal
|
||||||
is used to provide notification that an object has been successfully
|
:attr:`django.db.models.signals.post_save` is sent, allowing
|
||||||
saved. (These signals are not yet documented.)
|
any functions listening for that signal to take some customized
|
||||||
|
action.
|
||||||
|
|
||||||
How Django knows to UPDATE vs. INSERT
|
How Django knows to UPDATE vs. INSERT
|
||||||
-------------------------------------
|
-------------------------------------
|
||||||
|
Loading…
x
Reference in New Issue
Block a user