22 lines
643 B
Python
22 lines
643 B
Python
from django.contrib import admin
|
|
|
|
from .models import AccessLog
|
|
|
|
|
|
@admin.register(AccessLog)
|
|
class AccessLogAdmin(admin.ModelAdmin):
|
|
list_display = ('timestamp', 'username', 'method', 'path', 'ip_address')
|
|
list_filter = ('method', 'timestamp')
|
|
search_fields = ('username', 'path', 'ip_address')
|
|
readonly_fields = ('timestamp', 'username', 'method', 'path', 'ip_address')
|
|
ordering = ('-timestamp',)
|
|
|
|
def has_add_permission(self, request):
|
|
return False
|
|
|
|
def has_change_permission(self, request, obj=None):
|
|
return False
|
|
|
|
def has_delete_permission(self, request, obj=None):
|
|
return False
|