1
0
mirror of https://gitlab.com/animath/si/plateforme.git synced 2025-06-23 07:16:36 +02:00

Improve Django-admin interface, inlines and filters

Signed-off-by: Emmy D'Anello <emmy.danello@animath.fr>
This commit is contained in:
Emmy D'Anello
2024-02-23 21:43:44 +01:00
parent cae1c6fdb8
commit de504398d2
6 changed files with 372 additions and 185 deletions

View File

@ -589,6 +589,8 @@ class Payment(models.Model):
@property
def team(self):
return self.registrations.first().team
team.fget.short_description = _("team")
team.fget.admin_order_field = 'registrations__team__trigram'
@property
def tournament(self):
@ -596,6 +598,8 @@ class Payment(models.Model):
from participation.models import Tournament
return Tournament.final_tournament()
return self.registrations.first().team.participation.tournament
tournament.fget.short_description = _("tournament")
tournament.fget.admin_order_field = 'registrations__team__participation__tournament'
def get_checkout_intent(self, none_if_link_disabled=False):
if self.checkout_intent_id is None: