Skip to content

Instantly share code, notes, and snippets.

@Brick85
Last active December 1, 2015 12:42
Show Gist options
  • Save Brick85/b9188df039096d47b494 to your computer and use it in GitHub Desktop.
Save Brick85/b9188df039096d47b494 to your computer and use it in GitHub Desktop.
django admin methods
def get_actions(self, request):
actions = super(type(self), self).get_actions(request)
if 'delete_selected' in actions:
del actions['delete_selected']
return actions
def has_delete_permission(self, request, obj=None):
return False
def save_related(self, request, form, formsets, change):
super(type(self), self).save_related(request, form, formsets, change)
form.instance.save()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment