Ajout admin pour admin.LogEntry

This commit is contained in:
Claude Paroz 2025-03-20 14:49:20 +01:00
parent f345ec77b4
commit 078c67a455

View file

@ -3,6 +3,7 @@ from copy import deepcopy
from django import forms
from django.contrib import admin
from django.contrib.admin.models import LogEntry
from django.contrib.admin.helpers import ACTION_CHECKBOX_NAME
from django.contrib.auth.admin import GroupAdmin as AuthGroupAdmin
from django.contrib.auth.models import Group
@ -494,6 +495,38 @@ class GroupAdmin(AuthGroupAdmin):
])
@admin.register(LogEntry)
class LogEntryAdmin(admin.ModelAdmin):
"""Log Entry admin interface."""
date_hierarchy = "action_time"
fields = (
"action_time",
"user",
"content_type",
"object_id",
"object_repr",
"action_flag",
"change_message",
)
list_display = (
"action_time",
"user", #"user_link",
#"action_message",
"content_type",
"object_repr",
)
list_filter = (
"action_flag",
("content_type", admin.RelatedOnlyFieldListFilter),
("user", admin.RelatedOnlyFieldListFilter),
)
search_fields = (
"object_repr",
"change_message",
)
admin.site.register(Level)
admin.site.register(Option)
admin.site.register(StudentFile)