Add ability to know where an object was deleted from to pre/post delete signals
Since deleting objects deletes related objects, it would be good to know the origin of the delete.
It lets the signal listeners know why an object is being delete. If it's deleted from a model.delete(), you know which instance initiated the delete and if it's from a queryset.delete() you know which queryset initiated the delete, with the models in that queryset. Using this you know if the instance is being deleted directly or because it's related to another instance.
Change History
(14)
Component: |
Core framework → Database layer (models, ORM)
|
Triage Stage: |
Unreviewed → Accepted
|
Needs documentation: |
unset
|
Needs tests: |
unset
|
Owner: |
changed from nobody to Marcelo Galigniana
|
Status: |
new → assigned
|
Needs documentation: |
set
|
Needs tests: |
set
|
Patch needs improvement: |
set
|
Needs documentation: |
unset
|
Needs tests: |
unset
|
Patch needs improvement: |
unset
|
Triage Stage: |
Accepted → Ready for checkin
|
Resolution: |
→ fixed
|
Status: |
assigned → closed
|
See a possibly related issue in #6870.