1
0
mirror of https://gitlab.com/animath/si/plateforme.git synced 2025-07-04 01:32:11 +02:00

Pool support

This commit is contained in:
Yohann D'ANELLO
2020-05-05 04:45:38 +02:00
parent b6422c1a79
commit 104ca590a5
12 changed files with 348 additions and 10 deletions

View File

@ -3,7 +3,7 @@ from django.utils.translation import gettext as _
from django_tables2 import A
from member.models import Solution, Synthesis
from .models import Tournament, Team
from .models import Tournament, Team, Pool
class TournamentTable(tables.Table):
@ -105,3 +105,21 @@ class SynthesisTable(tables.Table):
attrs = {
'class': 'table table-condensed table-striped table-hover'
}
class PoolTable(tables.Table):
def render_teams(self, value):
return ", ".join(team.trigram for team in value.all())
def render_problems(self, value):
return ", ".join([str(pb) for pb in value])
def render_juries(self, value):
return ", ".join(str(jury) for jury in value.all())
class Meta:
model = Pool
fields = ("teams", "problems", "round", "juries", )
attrs = {
'class': 'table table-condensed table-striped table-hover'
}