plateforme-tfjm2/apps/member/admin.py

40 lines
999 B
Python
Raw Normal View History

2020-04-29 02:51:25 +00:00
from django.contrib.auth.admin import admin, UserAdmin
from polymorphic.admin import PolymorphicParentModelAdmin, PolymorphicChildModelAdmin
2020-04-29 05:39:52 +00:00
from member.models import TFJMUser, Document, Solution, Synthesis, MotivationLetter, Authorization, Config
2020-04-29 02:06:02 +00:00
2020-04-29 02:51:25 +00:00
@admin.register(TFJMUser)
class TFJMUserAdmin(UserAdmin):
list_display = ('email', 'first_name', 'last_name', 'role', )
2020-04-29 04:52:39 +00:00
@admin.register(Document)
class DocumentAdmin(PolymorphicParentModelAdmin):
child_models = (Authorization, MotivationLetter, Solution, Synthesis,)
2020-04-29 02:51:25 +00:00
polymorphic_list = True
2020-04-29 04:52:39 +00:00
@admin.register(Authorization)
class AuthorizationAdmin(PolymorphicChildModelAdmin):
pass
@admin.register(MotivationLetter)
class MotivationLetterAdmin(PolymorphicChildModelAdmin):
2020-04-29 02:51:25 +00:00
pass
@admin.register(Solution)
class SolutionAdmin(PolymorphicChildModelAdmin):
pass
@admin.register(Synthesis)
class SynthesisAdmin(PolymorphicChildModelAdmin):
pass
2020-04-29 05:39:52 +00:00
@admin.register(Config)
class ConfigAdmin(admin.ModelAdmin):
pass