36 lines
881 B
Python
36 lines
881 B
Python
from django.contrib import admin
|
|
|
|
from vbv_lernwelt.learning_mentor.models import (
|
|
AgentParticipantRelation,
|
|
MentorInvitation,
|
|
)
|
|
|
|
|
|
@admin.register(AgentParticipantRelation)
|
|
class TrainerParticipantRelationAdmin(admin.ModelAdmin):
|
|
list_display = ["agent", "participant", "role"]
|
|
|
|
search_fields = [
|
|
"agent__email",
|
|
"agent__first_name",
|
|
"agent__last_name",
|
|
"participant__user__email",
|
|
"participant__user__first_name",
|
|
"participant__user__last_name",
|
|
]
|
|
|
|
raw_id_fields = [
|
|
"agent",
|
|
"participant",
|
|
# "course_session",
|
|
]
|
|
|
|
list_filter = ["role"]
|
|
|
|
|
|
@admin.register(MentorInvitation)
|
|
class MentorInvitationAdmin(admin.ModelAdmin):
|
|
list_display = ["id", "email", "participant", "created"]
|
|
readonly_fields = ["id", "created", "email", "participant"]
|
|
search_fields = ["email"]
|