Opened 13 years ago

Closed 13 years ago

Last modified 12 years ago

#280 closed enhancement (fixed)

add _pre_delete and _post_delete hooks

Reported by: anonymous Owned by: Jacob
Component: Core (Other) Version:
Severity: normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


Currently one can define _pre_save and _post_save methods on a model, but no _*_delete methods. It's a useful feature missing, and trivial to implement. Just adding "if hasattr(self, '_pre_delete'): self._pre_delete()" (and the same for _post_delete) to method_delete() on
django/core/meta/ and two paragraphs documenting them on docs/model-api.txt .

Change History (2)

comment:1 Changed 13 years ago by Jacob

Owner: changed from Adrian Holovaty to Jacob
Status: newassigned

comment:2 Changed 13 years ago by Adrian Holovaty

Resolution: fixed
Status: assignedclosed

(In [432]) Fixed #280 -- Added _pre_delete() and _post_delete() hooks. Also updated the docs and added a unit testdjango/core/meta/

Note: See TracTickets for help on using tickets.
Back to Top