mirror of
https://gitlab.com/animath/si/plateforme.git
synced 2025-07-03 18:02:50 +02:00
Create tournaments
This commit is contained in:
@ -23,7 +23,8 @@ from tfjm.lists import get_sympa_client
|
||||
from tfjm.matrix import Matrix
|
||||
from tfjm.views import AdminMixin
|
||||
|
||||
from .forms import JoinTeamForm, ParticipationForm, RequestValidationForm, TeamForm, ValidateParticipationForm
|
||||
from .forms import JoinTeamForm, ParticipationForm, RequestValidationForm, TeamForm, ValidateParticipationForm, \
|
||||
TournamentForm
|
||||
from .models import Participation, Team, Tournament
|
||||
from .tables import TeamTable, TournamentTable
|
||||
|
||||
@ -404,5 +405,37 @@ class ParticipationDetailView(LoginRequiredMixin, DetailView):
|
||||
|
||||
|
||||
class TournamentListView(SingleTableView):
|
||||
"""
|
||||
Display the list of all tournaments.
|
||||
"""
|
||||
model = Tournament
|
||||
table_class = TournamentTable
|
||||
|
||||
|
||||
class TournamentCreateView(AdminMixin, CreateView):
|
||||
"""
|
||||
Create a new tournament.
|
||||
"""
|
||||
model = Tournament
|
||||
form_class = TournamentForm
|
||||
|
||||
def get_success_url(self):
|
||||
return reverse_lazy("participation:tournament_detail", args=(self.object.pk,))
|
||||
|
||||
|
||||
class TournamentUpdateView(AdminMixin, UpdateView):
|
||||
"""
|
||||
Update tournament detail.
|
||||
"""
|
||||
model = Tournament
|
||||
form_class = TournamentForm
|
||||
|
||||
def get_success_url(self):
|
||||
return reverse_lazy("participation:tournament_detail", args=(self.object.pk,))
|
||||
|
||||
|
||||
class TournamentDetailView(DetailView):
|
||||
"""
|
||||
Display tournament detail.
|
||||
"""
|
||||
model = Tournament
|
||||
|
Reference in New Issue
Block a user