Issue
How to remove the default delete action in Django admin? Would the following work?
actions = [ ]
Solution
This works:
def get_actions(self, request):
actions = super().get_actions(request)
if 'delete_selected' in actions:
del actions['delete_selected']
return actions
It's also the recommended way to do this based off Django's documentation below:
Conditionally enabling or disabling actions
Answered By - Dawn T Cherian
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.