from django.contrib import admin
from core.models import AuditLog


@admin.register(AuditLog)
class AuditLogAdmin(admin.ModelAdmin):
    list_display = ('action', 'target_type', 'target_id', 'user', 'created_at')
    list_filter = ('action', 'target_type', 'created_at')
    search_fields = ('action', 'target_type', 'target_id')
    readonly_fields = ('id', 'user', 'action', 'target_type', 'target_id', 'details', 'ip_address', 'created_at')
    ordering = ('-created_at',)
