Skip to content

Instantly share code, notes, and snippets.

@koddr koddr/admin.py forked from vero4karu/admin.py
Created Mar 7, 2018

Embed
What would you like to do?
Django: how to remove delete action/button from admin
class MyAdmin(admin.ModelAdmin):
def has_delete_permission(self, request, obj=None):
return False
def get_actions(self, request):
actions = super(MyAdmin, self).get_actions(request)
if 'delete_selected' in actions:
del actions['delete_selected']
return actions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.