1
0
mirror of https://gitlab.com/animath/si/plateforme.git synced 2025-06-22 15:58:24 +02:00

First interface to start draws

Signed-off-by: Emmy D'Anello <emmy.danello@animath.fr>
This commit is contained in:
Emmy D'Anello
2023-03-22 18:44:49 +01:00
parent 88823b5252
commit bde3758c50
8 changed files with 182 additions and 71 deletions

View File

@ -278,6 +278,13 @@ class Tournament(models.Model):
return Synthesis.objects.filter(final_solution=True)
return Synthesis.objects.filter(participation__tournament=self)
@property
def best_format(self):
n = len(self.participations.filter(valid=True).all())
fmt = [n] if n <= 5 else [3] * (n // 3 - 1) + [3 + n % 3]
return '+'.join(map(str, fmt))
def get_absolute_url(self):
return reverse_lazy("participation:tournament_detail", args=(self.pk,))