1
0
mirror of https://gitlab.com/animath/si/plateforme.git synced 2024-11-27 04:13:01 +00:00
plateforme-tfjm2/apps/member/admin.py

57 lines
1.4 KiB
Python
Raw Normal View History

2020-05-11 16:18:47 +00:00
from django.contrib.auth.admin import admin
2020-04-29 02:51:25 +00:00
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)
2020-05-11 16:18:47 +00:00
class TFJMUserAdmin(admin.ModelAdmin):
2020-05-11 12:08:19 +00:00
"""
Django admin page for users.
"""
2020-04-29 02:51:25 +00:00
list_display = ('email', 'first_name', 'last_name', 'role', )
2020-05-11 16:22:36 +00:00
search_fields = ('last_name', 'first_name',)
2020-04-29 02:51:25 +00:00
2020-04-29 04:52:39 +00:00
@admin.register(Document)
class DocumentAdmin(PolymorphicParentModelAdmin):
2020-05-11 12:08:19 +00:00
"""
Django admin page for any documents.
"""
2020-04-29 04:52:39 +00:00
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):
2020-05-11 12:08:19 +00:00
"""
Django admin page for Authorization.
"""
2020-04-29 04:52:39 +00:00
@admin.register(MotivationLetter)
class MotivationLetterAdmin(PolymorphicChildModelAdmin):
2020-05-11 12:08:19 +00:00
"""
Django admin page for Motivation letters.
"""
2020-04-29 02:51:25 +00:00
@admin.register(Solution)
class SolutionAdmin(PolymorphicChildModelAdmin):
2020-05-11 12:08:19 +00:00
"""
Django admin page for solutions.
"""
2020-04-29 02:51:25 +00:00
@admin.register(Synthesis)
class SynthesisAdmin(PolymorphicChildModelAdmin):
2020-05-11 12:08:19 +00:00
"""
Django admin page for syntheses.
"""
2020-04-29 05:39:52 +00:00
@admin.register(Config)
class ConfigAdmin(admin.ModelAdmin):
2020-05-11 12:08:19 +00:00
"""
Django admin page for configurations.
"""