From fd4280426b355fd6681b1b1abe588f21486c56c5 Mon Sep 17 00:00:00 2001 From: Yohann D'ANELLO Date: Thu, 21 Jan 2021 22:22:21 +0100 Subject: [PATCH] Add missing models in Django Admin --- apps/participation/admin.py | 7 ++++++- apps/registration/admin.py | 10 +++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/apps/participation/admin.py b/apps/participation/admin.py index acef641..54d4662 100644 --- a/apps/participation/admin.py +++ b/apps/participation/admin.py @@ -4,7 +4,7 @@ from django.contrib import admin from django.utils.translation import gettext_lazy as _ -from .models import Participation, Pool, Solution, Synthesis, Team, Tournament +from .models import Participation, Passage, Pool, Solution, Synthesis, Team, Tournament @admin.register(Team) @@ -31,6 +31,11 @@ class PoolAdmin(admin.ModelAdmin): search_fields = ('participations__team__name', 'participations__team__trigram',) +@admin.register(Passage) +class PassageAdmin(admin.ModelAdmin): + search_fields = ('pool__participations__team__name', 'pool__participations__team__trigram',) + + @admin.register(Solution) class SolutionAdmin(admin.ModelAdmin): list_display = ('participation',) diff --git a/apps/registration/admin.py b/apps/registration/admin.py index de6c4a1..04486cb 100644 --- a/apps/registration/admin.py +++ b/apps/registration/admin.py @@ -2,9 +2,10 @@ # SPDX-License-Identifier: GPL-3.0-or-later from django.contrib import admin +from django.contrib.admin import ModelAdmin from polymorphic.admin import PolymorphicChildModelAdmin, PolymorphicParentModelAdmin -from .models import AdminRegistration, CoachRegistration, Registration, StudentRegistration +from .models import AdminRegistration, CoachRegistration, Payment, Registration, StudentRegistration @admin.register(Registration) @@ -27,3 +28,10 @@ class CoachRegistrationAdmin(PolymorphicChildModelAdmin): @admin.register(AdminRegistration) class AdminRegistrationAdmin(PolymorphicChildModelAdmin): pass + + +@admin.register(Payment) +class PaymentAdmin(ModelAdmin): + list_display = ('registration', 'type', 'valid', ) + search_fields = ('registration__user__last_name', 'registration__user__first_name', 'registration__user__email',) + list_filter = ('type', 'valid',)