ernestophone.ens.fr/calendrier/admin.py

29 lines
731 B
Python
Raw Normal View History

2021-08-09 12:41:44 +02:00
from django.contrib import admin
2021-10-23 11:16:07 +02:00
from .models import Event, Participants
2022-03-15 01:08:18 +01:00
class ParticipantsAdmin(admin.ModelAdmin):
2022-03-15 01:08:18 +01:00
fields = [
"event",
"participant",
"reponse",
"instrument",
"instrument_autre",
"dont_play_main",
"details",
"creationDate",
"updateDate",
]
readonly_fields = ["creationDate", "updateDate"]
list_display = ["participant", "event", "reponse", "creationDate", "updateDate"]
2022-03-15 11:10:55 +01:00
def has_add_permission(self, req):
return False
def has_change_permission(self, change):
return False
2022-03-15 01:08:18 +01:00
# Add event by admin page return a 502 error
2021-08-09 12:41:44 +02:00
admin.site.register(Event)
admin.site.register(Participants, ParticipantsAdmin)