1
0
mirror of https://gitlab.com/animath/si/plateforme-corres2math.git synced 2025-07-08 20:50:19 +02:00

Add team table

This commit is contained in:
Yohann D'ANELLO
2020-11-16 11:58:05 +01:00
parent b0a3a22f83
commit ace1dbdc75
6 changed files with 171 additions and 108 deletions

View File

@ -23,7 +23,7 @@ from .forms import JoinTeamForm, ParticipationForm, PhaseForm, QuestionForm, \
ReceiveParticipationForm, RequestValidationForm, SendParticipationForm, TeamForm, \
UploadVideoForm, ValidateParticipationForm
from .models import Participation, Phase, Question, Team, Video
from .tables import CalendarTable
from .tables import CalendarTable, TeamTable
class CreateTeamView(LoginRequiredMixin, CreateView):
@ -119,6 +119,15 @@ class JoinTeamView(LoginRequiredMixin, FormView):
return reverse_lazy("participation:team_detail", args=(self.object.pk,))
class TeamListView(AdminMixin, SingleTableView):
"""
Display the whole list of teams
"""
model = Team
table_class = TeamTable
ordering = ('participation__problem', 'trigram',)
class MyTeamDetailView(LoginRequiredMixin, RedirectView):
"""
Redirect to the detail of the team in which the user is.