1
0
mirror of https://gitlab.com/animath/si/plateforme.git synced 2025-07-03 17:22:51 +02:00

Register pools

This commit is contained in:
Yohann D'ANELLO
2021-01-13 17:00:50 +01:00
parent 4faec03efb
commit 4d83664c0d
10 changed files with 91 additions and 12 deletions

View File

@ -288,6 +288,10 @@ class Pool(models.Model):
round = models.PositiveSmallIntegerField(
verbose_name=_("round"),
choices=[
(1, format_lazy(_("Round {round}"), round=1)),
(2, format_lazy(_("Round {round}"), round=2)),
]
)
participations = models.ManyToManyField(
@ -306,6 +310,9 @@ class Pool(models.Model):
def solutions(self):
return Solution.objects.filter(participation__in=self.participations, final_solution=self.tournament.final)
def get_absolute_url(self):
return reverse_lazy("participation:pool_detail", args=(self.pk,))
def __str__(self):
return _("Pool {round} for tournament {tournament} with teams {teams}")\
.format(round=self.round,