Django Admin delete_view could benefit from extension points
|Reported by:||gcc||Owned by:||nobody|
|Has patch:||yes||Needs documentation:||yes|
|Needs tests:||yes||Patch needs improvement:||no|
I want to increase control over who can delete what objects using the admin interface.
delete_view calls has_delete_permission(), which is fine, but then it calls get_deleted_objects() from django.contrib.admin.util.
This is very hard to override without monkey-patching get_deleted_objects(), because it requires replacing the whole of delete_view just to change one line.
I propose calling a member method get_deleted_objects(), which by default just calls the one from util, to make it easy to override this behaviour.
I've attached a patch without tests, because the existing tests should check that this doesn't break anything.