#27809: Add pre_add and post_add signals
-------------------------------------+-------------------------------------
Reporter: Oskar | Owner: nobody
Persson |
Type: New | Status: new
feature |
Component: Database | Version: master
layer (models, ORM) | Keywords: signals, many-to-
Severity: Normal | one
Triage Stage: | Has patch: 1
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 1
UI/UX: 0 |
-------------------------------------+-------------------------------------
There currently aren't any signals that are triggered when adding an
object to a Many-To-One relation. This prevents a developer from adding
additional custom functionality whenever this occurs. Currently the only
way around this is
[https://docs.djangoproject.com/en/1.10/ref/models/relations/#django.db.models.fields.related.RelatedManager.add
using add with bulk=False] which uses the save method instead of update,
which isn't always what you want to use.
When bulk=True an update query is used which means that #21461 would also
solve this issue. The problem with #21461 however is that there you want
all the objects added to the relation sent with the signal. In the pre_add
and post_add signals these aren't needed, here we only send the object
that other objects are added to, the "related" object.
--
Ticket URL: <https://code.djangoproject.com/ticket/27809>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/055.40a886a04904df8364f4458b3b1a36b2%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.