mirror of
https://gitlab.com/animath/si/plateforme.git
synced 2025-07-03 19:22:51 +02:00
Display the tournament list
This commit is contained in:
@ -1,10 +1,10 @@
|
||||
# Copyright (C) 2020 by Animath
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
from django.utils.text import format_lazy
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
import django_tables2 as tables
|
||||
|
||||
from .models import Team
|
||||
from .models import Team, Tournament
|
||||
|
||||
|
||||
# noinspection PyTypeChecker
|
||||
@ -54,3 +54,16 @@ class ParticipationTable(tables.Table):
|
||||
model = Team
|
||||
fields = ('name', 'trigram', 'problem',)
|
||||
template_name = 'django_tables2/bootstrap4.html'
|
||||
|
||||
|
||||
class TournamentTable(tables.Table):
|
||||
def render_date(self, record):
|
||||
return format_lazy(_("From {start} to {end}"), start=record.start, end=record.end)
|
||||
|
||||
class Meta:
|
||||
attrs = {
|
||||
'class': 'table table condensed table-striped',
|
||||
}
|
||||
model = Tournament
|
||||
fields = ('name', 'date',)
|
||||
template_name = 'django_tables2/bootstrap4.html'
|
||||
|
Reference in New Issue
Block a user