-
Notifications
You must be signed in to change notification settings - Fork 0
/
admin.py
46 lines (37 loc) · 979 Bytes
/
admin.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
"""
Implements the admin pages for the OA Switchboard plugin
"""
__copyright__ = "Copyright 2024 Birkbeck, University of London"
__author__ = "Martin Paul Eve"
__license__ = "AGPL v3"
__maintainer__ = "Birkbeck University of London"
from django.contrib import admin
from django.contrib.admin import ModelAdmin
from plugins.oas import models
class SwitchboardMessageAdmin(ModelAdmin):
"""
The admin interface for the switchboard messages
"""
list_display = (
"success",
"authorized",
"broadcast",
"message_type",
"message_date_time",
"article",
"_journal",
"message",
"response",
)
list_filter = (
"success",
"authorized",
"broadcast",
"message_type",
)
def _journal(self, obj):
return obj.article.journal
admin_list = [
(models.SwitchboardMessage, SwitchboardMessageAdmin),
]
[admin.site.register(*t) for t in admin_list]