views:

36

answers:

2

I've managed to disable the "Delete selected" action. Easy.

But a user can still click on an item and then there's the red Delete link at the bottom.

+1  A: 

Well you probably are using:

AdminSite.disable_action('delete_selected')

For further control just implement your own admin and set its actions to whatever you need:

class MyModelAdmin(admin.ModelAdmin):
    actions = ['whatever', 'actions']

Reference: http://docs.djangoproject.com/en/dev/ref/contrib/admin/actions/#disabling-a-site-wide-action

Yuval A
+4  A: 

Simply disable the yourapp.delete_yourmodel permission for that user or the group to which (s)he belongs.

Aidas Bendoraitis
Nice solution. +1
Yuval A