.delete() not called on related objects when 'parent' object is deleted

4 views
Skip to first unread message

Jeff Forcier

unread,
Oct 31, 2006, 7:55:37 PM10/31/06
to Django users
Howdy folks,

I just ran across the problem mentioned in this older thread:


http://groups.google.com/group/django-users/browse_thread/thread/2d1dc42cea162c4b/

The issue is exactly as stated there and in my own subject line -
deletion of related objects, via
core/db/models/query.py::delete_objects(), bypasses the related
objects' .delete() method. This is problematic for anyone who overrides
that method and expects it to be called consistently.

I couldn't find a Trac bug entry for this, and neither could the
original poster--if one does exist, please let me know :) Otherwise, I
will file one myself--I just wanted to double check.

I'll note that delete_objects() *does* call the pre_delete and
post_delete signals, which I will likely use as a temporary
alternative, but even so, I still feel that this behavior is
sufficiently incorrect/misleading that it should be fixed at some point
(I can write a patch if/when I get the time to examine it further :)).

Thanks,
Jeff

Reply all
Reply to author
Forward
0 new messages