plateforme-corres2math/apps/registration/admin.py

27 lines
778 B
Python
Raw Normal View History

2020-10-06 11:35:05 +00:00
from django.contrib import admin
from polymorphic.admin import PolymorphicChildModelAdmin, PolymorphicParentModelAdmin
2020-10-09 11:58:42 +00:00
from .models import AdminRegistration, CoachRegistration, Registration, StudentRegistration
2020-10-06 11:35:05 +00:00
@admin.register(Registration)
class RegistrationAdmin(PolymorphicParentModelAdmin):
child_models = (StudentRegistration, CoachRegistration, AdminRegistration,)
list_display = ("user", "type", "email_confirmed",)
polymorphic_list = True
@admin.register(StudentRegistration)
class StudentRegistrationAdmin(PolymorphicChildModelAdmin):
pass
@admin.register(CoachRegistration)
class CoachRegistrationAdmin(PolymorphicChildModelAdmin):
pass
@admin.register(AdminRegistration)
class AdminRegistrationAdmin(PolymorphicChildModelAdmin):
pass