1
0
mirror of https://gitlab.com/animath/si/plateforme.git synced 2025-07-06 06:43:59 +02:00

Display passages as a table

This commit is contained in:
Yohann D'ANELLO
2021-01-14 19:33:56 +01:00
parent 7397afd236
commit 1a7a411e10
4 changed files with 52 additions and 25 deletions

View File

@ -26,7 +26,7 @@ from tfjm.views import AdminMixin
from .forms import JoinTeamForm, NoteForm, ParticipationForm, PassageForm, PoolForm, PoolTeamsForm, \
RequestValidationForm, TeamForm, TournamentForm, ValidateParticipationForm, SolutionForm, SynthesisForm
from .models import Note, Participation, Passage, Pool, Team, Tournament, Solution, Synthesis
from .tables import TeamTable, TournamentTable, ParticipationTable, PoolTable, NoteTable
from .tables import NoteTable, PassageTable, PoolTable, TeamTable, TournamentTable, ParticipationTable
class CreateTeamView(LoginRequiredMixin, CreateView):
@ -489,6 +489,8 @@ class PoolDetailView(LoginRequiredMixin, DetailView):
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
context["passages"] = PassageTable(self.object.passages.all())
notes = dict()
for participation in self.object.participations.all():
notes[participation] = self.object.average(participation)