class AnchorBindAgentAdmin(admin.ModelAdmin):
def get_actions(self, request):
# 列表禁用删除操作
if 'delete_selected' in actions:
del actions['delete_selected']
return actions
def has_delete_permission(self, request, obj=None):
# 编辑页面禁用删除按钮
return False