# Imports
from django.contrib import admin
# from django.forms import ModelForm
# from django.utils.translation import ugettext_lazy as _
# Exports
__all__ = (
"BaseImpersonationHistoryAdmin",
)
# Models
[docs]class BaseImpersonationHistoryAdmin(admin.ModelAdmin):
"""Base model admin for ``ImpersonationHistoryModel``."""
[docs] def get_fields(self, request, obj=None):
return [
"session_key",
"impersonation_by",
"impersonation_for",
"start_dt",
"stop_dt",
"elapsed_duration",
"status",
]
[docs] def get_list_display(self, request):
return [
"session_key",
"impersonation_by",
"impersonation_for",
"start_dt",
"stop_dt",
"elapsed_duration",
"status",
]
[docs] def get_list_filter(self, request):
return [
"impersonation_by",
"impersonation_for",
"status",
]
[docs] def get_readonly_fields(self, request, obj=None):
return [
"session_key",
"impersonation_by",
"impersonation_for",
"start_dt",
"stop_dt",
"elapsed_duration",
"status",
]