1
0
mirror of https://gitlab.com/animath/si/plateforme.git synced 2024-12-25 20:22: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"), verbose_name=_("year"),
) )
@property
def teams(self):
return self._teams if not self.final else Team.objects.filter(selected_for_final=True)
@property @property
def linked_organizers(self): def linked_organizers(self):
return ['<a href="{url}">'.format(url=reverse_lazy("member:information", args=(user.pk,))) + str(user) + '</a>' 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 = models.ForeignKey(
Tournament, Tournament,
on_delete=models.PROTECT, on_delete=models.PROTECT,
related_name="teams", related_name="_teams",
verbose_name=_("tournament"), verbose_name=_("tournament"),
) )