Add missing models in Django Admin

This commit is contained in:
Yohann D'ANELLO 2021-01-21 22:22:21 +01:00
parent 1a63c1f399
commit fd4280426b
Signed by: ynerant
GPG Key ID: 3A75C55819C8CF85
2 changed files with 15 additions and 2 deletions

View File

@ -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',)

View File

@ -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',)