Add "mark as done" admin action for books

This commit is contained in:
Gabriel Augendre 2020-06-30 13:00:36 +02:00
parent 406b700ede
commit 0bdbe79828
No known key found for this signature in database
GPG Key ID: 1E693F4CE4AEE7B4
1 changed files with 5 additions and 1 deletions

View File

@ -157,7 +157,11 @@ class BookAdmin(ExportMixin, admin.ModelAdmin):
update_with_decitre.short_description = 'Mettre à jour avec Decitre'
actions = [update_with_decitre]
def mark_as_done(self, request, queryset):
queryset.update(done=True)
mark_as_done.short_description = "Marquer comme traité"
actions = [update_with_decitre, mark_as_done]
@admin.register(Editor)