Opened 19 years ago

Closed 19 years ago

Last modified 18 years ago

#1014 closed enhancement (fixed)

Allow _pre_save and _pre_delete to stop save / delete

Reported by: django@… 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)

patch.diff (1.3 KB ) - added by django@… 19 years ago.

Download all attachments as: .zip

Change History (2)

by django@…, 19 years ago

Attachment: patch.diff added

comment:1 by Adrian Holovaty, 19 years ago

Resolution: fixed
Status: newclosed

This was made possible when we merged the magic-removal branch. You can now override save() and delete().

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