forked from apluslms/a-plus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
admin.py
47 lines (42 loc) · 1.09 KB
/
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
47
from django.contrib import admin
from lib.admin_helpers import RecentCourseInstanceListFilter
from notification.models import Notification
class NotificationAdmin(admin.ModelAdmin):
search_fields = (
'subject',
'sender__user__first_name',
'sender__user__last_name',
'recipient__user__first_name',
'recipient__user__last_name',
'recipient__student_id',
'course_instance__course__name',
'course_instance__course__code',
'course_instance__instance_name',
)
list_display = (
'course_instance',
'subject',
'sender',
'recipient',
'timestamp',
'submission',
'seen',
)
list_display_links = (
'course_instance',
'sender',
'subject',
)
list_filter = (
'seen',
'timestamp',
RecentCourseInstanceListFilter,
)
raw_id_fields = (
'sender',
'recipient',
'course_instance',
'submission',
)
readonly_fields = ('timestamp',)
admin.site.register(Notification, NotificationAdmin)