How To Add Custom Django Admin Actions

In this article we  explain how to add custom django admin action. Let's say that we have model called Products which have status Available and Not Available and we want to  have options in  django Admin to change status  in Available or Not available ..



In we have :


    ('not','Not Available'),

class Products(models.Model):

    class Meta:
        verbose_name_plural="MY PRODUCTS"


Syncronize your database .

python syncdb

if you're using south , then

python schemamigration <app_name> --auto

python migrate <app_name>


if you're using Django1.7

python makemigrations
python migrate


STATUS_CHOICHE - An iterable (e.g., a list or tuple) consisting itself of iterables of exactly two items (e.g. [(A, B), (A, B) ...]) to use as choices for this field. Read more ..

verbose_name_plura - The plural name for the object.. Read more

Then we will add custom actions for our model . You should add in


def available (modeladmin,request,queryset):

def not_available (modeladmin,request,queryset):

class ProductsAdmin(admin.ModelAdmin):


Now, you'll have two new option in Django admin avaialble and available ..if you have any question feel free to  ask .. Dec. 23, 2014, 12:36 p.m.