from django.contrib import admin
from .models import APILog


@admin.register(APILog)
class APILogAdmin(admin.ModelAdmin):
    list_display = ('user', 'request_url', 'request_params', 'request_method', 'request_body', 'request_timestamp')
    list_filter = ('user', 'request_method')
    search_fields = ('request_url',)
    ordering = ('-request_timestamp',)

    actions = None

    def has_delete_permission(self, request, obj=None):
        return False
