Opened 16 years ago

Last modified 13 years ago

#6915 closed

object.some_set.all().delete() does not call the delete method on some object — at Version 5

Reported by: gert@… Owned by: nobody
Component: Documentation Version: dev
Severity: Keywords: qsrf-cleanup delete
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: yes
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by Ramiro Morales)

If you override an objects delete method:

object.something_set.all().delete()

does not do the same as:

for something in object.something_set.all():
    something.delete()

The new delete method is never called and hence any associated cleanup or audit code are never called. This comes to light when you delete an object which in turn deletes related objects.

Change History (9)

by Johannes Dollinger, 16 years ago

Attachment: 6915.naive-patch.diff added

comment:1 by Johannes Dollinger, 16 years ago

Component: Core frameworkDatabase wrapper
Has patch: set
Needs documentation: set
Patch needs improvement: set

by Johannes Dollinger, 16 years ago

Attachment: 6915.naive-patch.2.diff added

by anonymous, 16 years ago

Attachment: 6915.regressiontest.diff added

comment:2 by Johannes Dollinger, 16 years ago

Triage Stage: UnreviewedDesign decision needed

comment:3 by anonymous, 16 years ago

Keywords: qsrf-cleanup added

comment:4 by Jacob, 16 years ago

milestone: 1.0

comment:5 by Ramiro Morales, 16 years ago

Description: modified (diff)

by Johannes Dollinger, 16 years ago

Attachment: 6915.naive.r7787.diff added
Note: See TracTickets for help on using tickets.
Back to Top