Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Customization of delete_selected ModelAdmin action for post and pre operations.
Latest commit 48d0647 @saippuakauppias Update README.rst
Failed to load latest commit information.
custom_delete_selected fix action for django v.1.4
.gitignore initial commit
LICENSE initial commit update
README.rst Update README.rst update


Custom delete_selected action

Django delete_selected action in ModelAdmin not allow you to add operations before and after deleting objects from database by default.


Default delete_selected action using delete method of queryset so need to use pre_delete and post_delete signals.


Disable delete_selected action for all applications and models, but for some models this is crazy.


The easiest way to install package is with pip!

You can install from PyPI (for Django==1.4):

$ pip install django-custom_delete_selected

Or GitHub for Django==1.4:

$ pip install -e git+

Or GitHub for Django==1.3.x:

$ pip install -e git+

Or from source:

$ git clone
$ cd django-custom_delete_selected
$ python install


Import custom_delete_selected.admin.CustomDeleteSelected to extend ModelAdmin class and override delete_model method. For example:

from django.contrib import admin
from custom_delete_selected.admin import CustomDeleteSelected

class MyModelAdmin(CustomDeleteSelected, admin.ModelAdmin):

    # your code

    def delete_model(self, request, obj):
        # pre delete operations
        super(MyModelAdmin, self).delete_model(request, obj)
        # post delete operations

This code allow extends you deleting one object (when delete from change_form) and same objects (when delete from change_list).


Feel free to fork, send pull requests or report bugs and issues on github.

[![Bitdeli Badge](]( "Bitdeli Badge")

Something went wrong with that request. Please try again.