2020-04-29 04:51:25 +02:00
|
|
|
from django.contrib.auth.admin import admin, UserAdmin
|
|
|
|
from polymorphic.admin import PolymorphicParentModelAdmin, PolymorphicChildModelAdmin
|
|
|
|
from member.models import TFJMUser, AbstractDocument, Document, Solution, Synthesis
|
2020-04-29 04:06:02 +02:00
|
|
|
|
2020-04-29 04:51:25 +02:00
|
|
|
|
|
|
|
@admin.register(TFJMUser)
|
|
|
|
class TFJMUserAdmin(UserAdmin):
|
|
|
|
list_display = ('email', 'first_name', 'last_name', 'role', )
|
|
|
|
|
|
|
|
|
|
|
|
@admin.register(AbstractDocument)
|
|
|
|
class AbstractDocumentAdmin(PolymorphicParentModelAdmin):
|
|
|
|
child_models = (Document, Solution, Synthesis,)
|
|
|
|
polymorphic_list = True
|
|
|
|
|
|
|
|
|
|
|
|
@admin.register(Document)
|
|
|
|
class DocumentAdmin(PolymorphicChildModelAdmin):
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
@admin.register(Solution)
|
|
|
|
class SolutionAdmin(PolymorphicChildModelAdmin):
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
@admin.register(Synthesis)
|
|
|
|
class SynthesisAdmin(PolymorphicChildModelAdmin):
|
|
|
|
pass
|