mirror of
https://gitlab.com/animath/si/plateforme.git
synced 2025-07-03 17:22:51 +02:00
Display details about tournaments
This commit is contained in:
@ -26,7 +26,7 @@ from tfjm.views import AdminMixin
|
||||
from .forms import JoinTeamForm, ParticipationForm, RequestValidationForm, TeamForm, ValidateParticipationForm, \
|
||||
TournamentForm
|
||||
from .models import Participation, Team, Tournament
|
||||
from .tables import TeamTable, TournamentTable
|
||||
from .tables import TeamTable, TournamentTable, ParticipationTable
|
||||
|
||||
|
||||
class CreateTeamView(LoginRequiredMixin, CreateView):
|
||||
@ -129,7 +129,7 @@ class TeamListView(AdminMixin, SingleTableView):
|
||||
"""
|
||||
model = Team
|
||||
table_class = TeamTable
|
||||
ordering = ('participation__problem', 'trigram',)
|
||||
ordering = ('trigram',)
|
||||
|
||||
|
||||
class MyTeamDetailView(LoginRequiredMixin, RedirectView):
|
||||
@ -430,3 +430,8 @@ class TournamentDetailView(DetailView):
|
||||
Display tournament detail.
|
||||
"""
|
||||
model = Tournament
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
context = super().get_context_data(**kwargs)
|
||||
context["teams"] = ParticipationTable(self.object.participations.all())
|
||||
return context
|
||||
|
Reference in New Issue
Block a user