27 lines
617 B
Python
27 lines
617 B
Python
from vbv_lernwelt.core.admin import LogAdmin
|
|
|
|
|
|
# admin.register in apps.py
|
|
class CustomNotificationAdmin(LogAdmin):
|
|
date_hierarchy = "timestamp"
|
|
raw_id_fields = ("recipient",)
|
|
list_display = (
|
|
"recipient",
|
|
"actor",
|
|
"notification_type",
|
|
"emailed",
|
|
"unread",
|
|
)
|
|
list_filter = (
|
|
"notification_type",
|
|
"emailed",
|
|
"unread",
|
|
"timestamp",
|
|
"level",
|
|
"public",
|
|
)
|
|
|
|
def get_queryset(self, request):
|
|
qs = super(CustomNotificationAdmin, self).get_queryset(request)
|
|
return qs.prefetch_related("actor")
|