1
0
mirror of https://gitlab.com/animath/si/plateforme.git synced 2025-06-21 19:58:25 +02:00

Update draw with the new team repartition

Signed-off-by: Emmy D'Anello <emmy.danello@animath.fr>
This commit is contained in:
Emmy D'Anello
2024-03-24 21:37:37 +01:00
parent e9ae1fcb60
commit df036ba384
3 changed files with 52 additions and 24 deletions

View File

@ -93,7 +93,7 @@ class TeamAdmin(admin.ModelAdmin):
class ParticipationAdmin(admin.ModelAdmin):
list_display = ('team', 'tournament', 'valid', 'final',)
search_fields = ('team__name', 'team__trigram',)
list_filter = ('valid',)
list_filter = ('valid', 'tournament',)
autocomplete_fields = ('team', 'tournament',)
inlines = (SolutionInline, SynthesisInline,)

View File

@ -407,7 +407,7 @@ class Tournament(models.Model):
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, sorted(fmt, reverse=True)))
return '+'.join(map(str, sorted(fmt)))
def get_absolute_url(self):
return reverse_lazy("participation:tournament_detail", args=(self.pk,))