mirror of
https://gitlab.com/animath/si/plateforme.git
synced 2025-10-19 12:26:41 +02:00
Display tournament list
This commit is contained in:
20
apps/tournament/tables.py
Normal file
20
apps/tournament/tables.py
Normal file
@@ -0,0 +1,20 @@
|
||||
import django_tables2 as tables
|
||||
from django.utils.translation import gettext as _
|
||||
|
||||
from .models import Tournament
|
||||
|
||||
|
||||
class TournamentTable(tables.Table):
|
||||
date_start = tables.Column(
|
||||
verbose_name=_("dates").capitalize(),
|
||||
)
|
||||
|
||||
def render_date_start(self, record):
|
||||
return _("From {start:%b %d %Y} to {end:%b %d %Y}").format(start=record.date_start, end=record.date_end)
|
||||
|
||||
class Meta:
|
||||
model = Tournament
|
||||
fields = ("name", "date_start", "date_inscription", "date_solutions", "size", )
|
||||
attrs = {
|
||||
'class': 'table table-condensed table-striped table-hover'
|
||||
}
|
Reference in New Issue
Block a user