-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathadmin.py
39 lines (26 loc) · 1.07 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
from django.contrib import admin
from plugins.apc.models import *
class SectionAPCAdmin(admin.ModelAdmin):
list_display = ('section_name', 'value', 'currency')
list_filter = ('currency',)
def section_name(self, obj):
return obj.section.name
class WaiverApplicationAdmin(admin.ModelAdmin):
list_display = ('pk', 'article', 'reviewer', 'status')
raw_id_fields = ('reviewer',)
class ArticleAPCAdmin(admin.ModelAdmin):
list_display = ('pk', 'article', 'value', 'currency', 'recorded', 'status')
list_filter = ('status', 'currency')
raw_id_fields = ('article', 'section_apc')
class BillingStafferAdmin(admin.ModelAdmin):
list_display = ('pk', 'journal', 'staffer', 'receives_notifications')
list_filter = ('journal', 'staffer', 'receives_notifications')
raw_id_fields = ('journal', 'staffer')
admin_list = [
(SectionAPC, SectionAPCAdmin),
(WaiverApplication, WaiverApplicationAdmin),
(ArticleAPC, ArticleAPCAdmin),
(BillingStaffer, BillingStafferAdmin),
(Discount,),
]
[admin.site.register(*t) for t in admin_list]