#1014 closed enhancement (fixed)
Allow _pre_save and _pre_delete to stop save / delete
Reported by: | Owned by: | Adrian Holovaty | |
---|---|---|---|
Component: | Metasystem | 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
It'd be useful in some situations if a _pre_save or _pre_delete hook could signal that the saving or deleting shouldn't go ahead. Throwing an exception isn't the best way to handle it if it's not actually exceptional behaviour. For instance, in a version control system, on _pre_delete you might wish to alter the status to 'deleted' but stop the actual object from being deleted.
Attachments (1)
Change History (2)
by , 19 years ago
Attachment: | patch.diff added |
---|
comment:1 by , 18 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
This was made possible when we merged the magic-removal branch. You can now override
save()
anddelete()
.