Code

Opened 4 years ago

Last modified 3 years ago

#13251 new New feature

Add ability to know where an object was deleted from to pre/post delete signals

Reported by: skoom Owned by: nobody
Component: Database layer (models, ORM) Version: master
Severity: Normal Keywords: signals
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: yes
Needs tests: yes Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

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.

Attachments (1)

changes.patch (2.6 KB) - added by skoom 4 years ago.

Download all attachments as: .zip

Change History (9)

Changed 4 years ago by skoom

comment:1 Changed 4 years ago by skoom

  • Needs documentation set
  • Needs tests unset
  • Patch needs improvement unset

comment:2 Changed 4 years ago by anonymous

  • Needs tests set

comment:3 Changed 4 years ago by russellm

  • Component changed from Core framework to Database layer (models, ORM)
  • Triage Stage changed from Unreviewed to Accepted

comment:4 Changed 3 years ago by julien

See a possibly related issue in #6870.

comment:5 Changed 3 years ago by lukeplant

  • Type set to New feature

comment:6 Changed 3 years ago by lukeplant

  • Severity set to Normal

comment:7 Changed 2 years ago by aaugustin

  • UI/UX unset

Change UI/UX from NULL to False.

comment:8 Changed 2 years ago by aaugustin

  • Easy pickings unset

Change Easy pickings from NULL to False.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as new
The owner will be changed from nobody to anonymous. Next status will be 'assigned'
as The resolution will be set. Next status will be 'closed'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.