add a ModelAdmin.delete_model method, similar to ModelAdmin.save_model (+patch)
|Reported by:||thomas||Owned by:||nobody|
|Cc:||jay.wineinger@…, Florian Apolloner||Triage Stage:||Accepted|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||yes||Patch needs improvement:||no|
When we delete an object, it could be usefull to have the "request" attribute. For example to know "how is doing this delete", as shown as the exemple with save_model (http://docs.djangoproject.com/en/1.0/ref/contrib/admin/#modeladmin-methods).
My very little patch creates a ModelAdmin.delete_model(self, request, obj) method, one can override in admin.py.
I use it in a custom log system, where I log all details of all modifications of a object, with the "modifier" who make the modification (request.user). I can log creations and modifications with save_model, now I can log delete() too.
Change History (19)
comment:2 follow-up: 4 Changed 8 years ago by
|Patch needs improvement:||set|