#10754: post and pre_delete signal documentation imprecise
------------------------------------+---------------------------------------
Reporter: runeh | Owner: nobody
Status: closed | Milestone:
Component: Documentation | Version: SVN
Resolution: duplicate | Keywords: signals
Stage: Unreviewed | Has_patch: 0
Needs_docs: 0 | Needs_tests: 0
Needs_better_patch: 0 |
------------------------------------+---------------------------------------
Changes (by kmtracey):
* status: new => closed
* needs_better_patch: => 0
* resolution: => duplicate
* needs_tests: => 0
* needs_docs: => 0
Comment:
The fact that the individual model delete() methods are not called is
documented:
http://docs.djangoproject.com/en/dev/topics/db/queries/#deleting-objects
"Keep in mind that this will, whenever possible, be executed purely in
SQL, and so the delete() methods of individual object instances will not
necessarily be called during the process. If you've provided a custom
delete() method on a model class and want to ensure that it is called, you
will need to "manually" delete instances of that model (e.g., by iterating
over a !QuerySet and calling delete() on each object individually) rather
than using the bulk delete() method of a !QuerySet."
If the individual detele() methods are not called, it follows that the
associated signal handlers won't be either.
#10751 is already open for the issue of bulk delete in admin bypassing
individual instance methods. I think where doc is missing is for admin
actions: a note about how, by default, bulk delete in admin will use
queryset delete() and therefore bypass instance method customizations, and
an indication of how to change this behavior (provide your own customized
delete action), if you always want your individual methods called.
--
Ticket URL: <http://code.djangoproject.com/ticket/10754#comment:1>
Django <http://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 post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---