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:
@ -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'
|
||||
}
|
||||
|
Reference in New Issue
Block a user