1
0
mirror of https://gitlab.com/animath/si/plateforme.git synced 2024-12-25 07:42:22 +00:00

Display teams selected for the final

This commit is contained in:
Yohann D'ANELLO 2020-05-05 14:17:06 +02:00
parent 9f22157ccf
commit bfba07b7a2

View File

@ -79,6 +79,10 @@ class Tournament(models.Model):
verbose_name=_("year"),
)
@property
def teams(self):
return self._teams if not self.final else Team.objects.filter(selected_for_final=True)
@property
def linked_organizers(self):
return ['<a href="{url}">'.format(url=reverse_lazy("member:information", args=(user.pk,))) + str(user) + '</a>'
@ -122,7 +126,7 @@ class Team(models.Model):
tournament = models.ForeignKey(
Tournament,
on_delete=models.PROTECT,
related_name="teams",
related_name="_teams",
verbose_name=_("tournament"),
)