django admin action

# Add this code to admin.py
#example : Published Article
def make_published(modeladmin, request, queryset):
    queryset.update(status='p')
make_published.short_description = "Mark selected stories as published"

Here is what the above code is Doing:
1. We’re creating a function called make_published.
2. We’re giving it two parameters: modeladmin and request.
3. We’re giving it a third parameter, queryset, which is set to queryset.update(status=’p’).
4. We’re setting the short_description property of the function to “Mark selected stories as published”.