Opened 19 years ago

Closed 19 years ago

Last modified 18 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: no UI/UX: no

Description

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/init.py and two paragraphs documenting them on docs/model-api.txt .

Change History (2)

comment:1 by Jacob, 19 years ago

Owner: changed from Adrian Holovaty to Jacob
Status: newassigned

comment:2 by Adrian Holovaty, 19 years ago

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/init.py

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