Is possible to have action display in Django Admin with a different name than its function name?
for example:
def an_action():
pass
class AdminPanel(admin.ModelAdmin):
actions = [ an_action]
In the Django admin panel an_action
would display as "An action". Could I made this display something arbitrary like "Best Action Ever" instead of "An Action"?
Try this:
def an_action():
pass
an_action.short_description = 'my label'
class AdminPanel(admin.ModelAdmin):
actions = [an_action]