1 2 3 4 5 6 7 8 9 10 11 12 13 14 | from django.contrib.admin.decorators import admin_action
# inside CommentManager in django.contrib.comments.models
@admin_action( name='Delete selected posts' )
def multi_delete( self, id_list ):
res = ""
for id in id_list:
obj = self.get( pk=id )
res += repr( obj )
obj.delete()
res += "<br/>\n"
return "Deleted %s" % res
|
More like this
- MintCache by gfranxman 6 years, 1 month ago
- Add delete buttons to admin changelist by kylefox 5 years, 12 months ago
- Hackish Way to Execute on manage.py Action by joshua 6 years, 2 months ago
- Extended cacheable callables and properties by gsakkis 2 years, 11 months ago
- Redirect with change list with filters intact with admin actions by AndrewIngram 3 years, 10 months ago
Comments