mirror of
https://gitlab.com/animath/si/plateforme.git
synced 2024-11-27 01:27:09 +00:00
57 lines
1.4 KiB
Python
57 lines
1.4 KiB
Python
from django.contrib.auth.admin import admin
|
|
from polymorphic.admin import PolymorphicParentModelAdmin, PolymorphicChildModelAdmin
|
|
from member.models import TFJMUser, Document, Solution, Synthesis, MotivationLetter, Authorization, Config
|
|
|
|
|
|
@admin.register(TFJMUser)
|
|
class TFJMUserAdmin(admin.ModelAdmin):
|
|
"""
|
|
Django admin page for users.
|
|
"""
|
|
list_display = ('email', 'first_name', 'last_name', 'role', )
|
|
search_fields = ('last_name', 'first_name',)
|
|
|
|
|
|
@admin.register(Document)
|
|
class DocumentAdmin(PolymorphicParentModelAdmin):
|
|
"""
|
|
Django admin page for any documents.
|
|
"""
|
|
child_models = (Authorization, MotivationLetter, Solution, Synthesis,)
|
|
polymorphic_list = True
|
|
|
|
|
|
@admin.register(Authorization)
|
|
class AuthorizationAdmin(PolymorphicChildModelAdmin):
|
|
"""
|
|
Django admin page for Authorization.
|
|
"""
|
|
|
|
|
|
@admin.register(MotivationLetter)
|
|
class MotivationLetterAdmin(PolymorphicChildModelAdmin):
|
|
"""
|
|
Django admin page for Motivation letters.
|
|
"""
|
|
|
|
|
|
@admin.register(Solution)
|
|
class SolutionAdmin(PolymorphicChildModelAdmin):
|
|
"""
|
|
Django admin page for solutions.
|
|
"""
|
|
|
|
|
|
@admin.register(Synthesis)
|
|
class SynthesisAdmin(PolymorphicChildModelAdmin):
|
|
"""
|
|
Django admin page for syntheses.
|
|
"""
|
|
|
|
|
|
@admin.register(Config)
|
|
class ConfigAdmin(admin.ModelAdmin):
|
|
"""
|
|
Django admin page for configurations.
|
|
"""
|