-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathadmin.py
More file actions
41 lines (33 loc) · 1.23 KB
/
admin.py
File metadata and controls
41 lines (33 loc) · 1.23 KB
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
from django.contrib import admin
from wg21_paper_tracker.models import WG21Mailing, WG21Paper, WG21PaperAuthor
@admin.register(WG21Mailing)
class WG21MailingAdmin(admin.ModelAdmin):
list_display = ("mailing_date", "title", "created_at", "updated_at")
search_fields = ("mailing_date", "title")
ordering = ("-mailing_date",)
class WG21PaperAuthorInline(admin.TabularInline):
model = WG21PaperAuthor
extra = 1
raw_id_fields = ("profile",)
ordering = ("author_order", "id")
@admin.register(WG21Paper)
class WG21PaperAdmin(admin.ModelAdmin):
list_display = (
"paper_id",
"year",
"title",
"document_date",
"mailing",
"subgroup",
"is_downloaded",
)
search_fields = ("paper_id", "title", "url", "subgroup")
list_filter = ("is_downloaded", "subgroup", "mailing", "year")
ordering = ("-document_date", "-paper_id")
inlines = [WG21PaperAuthorInline]
@admin.register(WG21PaperAuthor)
class WG21PaperAuthorAdmin(admin.ModelAdmin):
list_display = ("paper", "profile", "author_order", "created_at")
search_fields = ("paper__paper_id", "profile__display_name")
raw_id_fields = ("paper", "profile")
ordering = ("paper", "author_order", "id")