Files
hoopscout/apps/ingestion/admin.py

33 lines
922 B
Python

from django.contrib import admin
from .models import IngestionError, IngestionRun
class IngestionErrorInline(admin.TabularInline):
model = IngestionError
extra = 0
readonly_fields = ("occurred_at",)
@admin.register(IngestionRun)
class IngestionRunAdmin(admin.ModelAdmin):
list_display = (
"provider_namespace",
"job_type",
"status",
"records_processed",
"records_failed",
"started_at",
"finished_at",
)
list_filter = ("provider_namespace", "job_type", "status")
search_fields = ("provider_namespace",)
inlines = (IngestionErrorInline,)
@admin.register(IngestionError)
class IngestionErrorAdmin(admin.ModelAdmin):
list_display = ("provider_namespace", "entity_type", "external_id", "severity", "occurred_at")
list_filter = ("severity", "provider_namespace")
search_fields = ("entity_type", "external_id", "message")