add _pre_delete and _post_delete hooks
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)
Owner: |
changed from Adrian Holovaty to Jacob
|
Status: |
new → assigned
|
Resolution: |
→ fixed
|
Status: |
assigned → closed
|
(In [432]) Fixed #280 -- Added _pre_delete() and _post_delete() hooks. Also updated the docs and added a unit testdjango/core/meta/init.py