Opened 5 years ago
Closed 5 years ago
#31889 closed Bug (invalid)
Django actions
| Reported by: | Sleiman Bassim | Owned by: | anujpandey785 |
|---|---|---|---|
| Component: | Documentation | Version: | 3.1 |
| Severity: | Normal | Keywords: | actions |
| Cc: | Triage Stage: | Unreviewed | |
| Has patch: | no | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | yes | UI/UX: | no |
Description
Hi,
In the Admin actions documentation https://docs.djangoproject.com/en/3.1/ref/contrib/admin/actions/
make_published.short_description should be self.short_description
Context:
class ArticleAdmin(admin.ModelAdmin):
...
actions = ['make_published']
def make_published(self, request, queryset):
queryset.update(status='p')
make_published.short_description = "Mark selected stories as published"
Change History (2)
comment:1 by , 5 years ago
| Owner: | changed from to |
|---|---|
| Status: | new → assigned |
comment:2 by , 5 years ago
| Resolution: | → invalid |
|---|---|
| Status: | assigned → closed |
Note:
See TracTickets
for help on using tickets.
The docs are correct, we're setting
short_descriptionto the admin action, not theModelAdmininstance itself.