19 lines
642 B
Python
19 lines
642 B
Python
from django.contrib import admin
|
|
|
|
from jobs.models import Job, JobEvent
|
|
|
|
|
|
@admin.register(Job)
|
|
class JobAdmin(admin.ModelAdmin):
|
|
list_display = ("id", "type", "status", "priority", "attempts", "max_attempts", "locked_by", "available_at")
|
|
list_filter = ("status", "type")
|
|
search_fields = ("id", "type", "idempotency_key", "locked_by")
|
|
readonly_fields = ("created_at", "updated_at", "finished_at")
|
|
|
|
|
|
@admin.register(JobEvent)
|
|
class JobEventAdmin(admin.ModelAdmin):
|
|
list_display = ("id", "job", "type", "attempt", "worker_id", "created_at")
|
|
list_filter = ("type",)
|
|
search_fields = ("job__id", "worker_id", "message")
|