mirror of
https://github.com/jointakahe/takahe.git
synced 2024-11-29 02:31:00 +00:00
21 lines
505 B
Python
21 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,
|
|
)
|