I have the need to change the function of delete - I need to confirm the object has no FK connections and if it does, to deny the delete request.
In the relevant Django documentation it is suggested that the pre- and post-delete signals be used instead, as these are called during bulk deletion, cf the Model object's delete method, which is not called.
Then I read this answer to a similar question which is suggesting that using the signals then excludes delete() calls via the shell/API/script.
I do not know enough about signals to be able to verify this claim, but I am now in a conundrum - I still need to monitor the deleting of objects and reject any that fail certain criteria - regardless of whether done via Model.delete() or directly via SQL.
What solutions have people used to get around this problem?
FWIW: I have authorizations and authentication under control, this will be a fail safe.