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 04:52:39 +00:00
|
|
|
from member.models import TFJMUser, Document, Solution, Synthesis, MotivationLetter, Authorization
|
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
|