ernestophone.ens.fr/calendrier/admin.py
Lucie Galland 31f6dc0961 bug fix
2022-03-15 11:28:44 +01:00

28 lines
741 B
Python

from django.contrib import admin
from .models import Event, Participants
class ParticipantsAdmin(admin.ModelAdmin):
fields = [
"event",
"participant",
"reponse",
"instrument",
"instrument_autre",
"dont_play_main",
"details",
"creationDate",
"updateDate",
]
readonly_fields = ["creationDate", "updateDate"]
list_display = ["participant", "event", "reponse", "creationDate", "updateDate"]
def has_add_permission(self, req):
return False
def has_change_permission(self,obj, change=False):
return False
# Add event by admin page return a 502 error
admin.site.register(Event)
admin.site.register(Participants, ParticipantsAdmin)