-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathadmin.py
72 lines (56 loc) · 1.83 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
from django.contrib import admin
from .models import Account, List, ListRegistration, ListUpvote
@admin.register(List)
class ListAdmin(admin.ModelAdmin):
list_display = (
"id",
"on_chain_id",
"name",
"description",
"cover_image_url",
"owner",
"admin_only_registrations",
"default_registration_status",
"created_at",
"updated_at",
)
list_filter = ("created_at", "updated_at", "default_registration_status")
search_fields = ("name", "owner__id")
ordering = ("-created_at",)
def has_add_permission(self, request):
return False
def has_change_permission(self, request, obj=None):
return False
def has_delete_permission(self, request, obj=None):
return False
@admin.register(ListUpvote)
class ListUpvoteAdmin(admin.ModelAdmin):
list_display = ("id", "list", "account", "created_at")
list_filter = ("created_at",)
search_fields = ("list__name", "account__id")
def has_add_permission(self, request):
return False
def has_change_permission(self, request, obj=None):
return False
def has_delete_permission(self, request, obj=None):
return False
@admin.register(ListRegistration)
class ListRegistrationAdmin(admin.ModelAdmin):
list_display = (
"id",
"list",
"registrant",
"registered_by",
"status",
"submitted_at",
"updated_at",
)
list_filter = ("status", "submitted_at", "updated_at")
search_fields = ("list__name", "registrant__id", "registered_by__id")
ordering = ("-submitted_at",)
def has_add_permission(self, request):
return False
def has_change_permission(self, request, obj=None):
return False
def has_delete_permission(self, request, obj=None):
return False