This repository has been archived on 2023-09-24. You can view files and clone it, but cannot push or open issues or pull requests.
takahe/miniq/admin.py
2022-11-05 22:49:25 -06:00

22 lines
505 B
Python

from django.contrib import admin
from miniq.models import Task
@admin.register(Task)
class TaskAdmin(admin.ModelAdmin):
list_display = ["id", "created", "type", "subject", "completed", "failed"]
ordering = ["-created"]
actions = ["reset"]
@admin.action(description="Reset Task")
def reset(self, request, queryset):
queryset.update(
failed=None,
completed=None,
locked=None,
locked_by=None,
error=None,
)