Django

Code

Ticket #1014 (closed: fixed)

Opened 3 years ago

Last modified 2 years ago

Allow _pre_save and _pre_delete to stop save / delete

Reported by: django@illuminosity.net Assigned to: adrian
Milestone: Component: Metasystem
Version: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: 0 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

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

patch.diff (1.3 kB) - added by django@illuminosity.net on 12/06/05 19:22:27.

Change History

12/06/05 19:22:27 changed by django@illuminosity.net

  • attachment patch.diff added.

05/21/06 22:03:58 changed by adrian

  • status changed from new to closed.
  • resolution set to fixed.

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


Add/Change #1014 (Allow _pre_save and _pre_delete to stop save / delete)




Change Properties
Action