diff --git a/apps/participation/models.py b/apps/participation/models.py index 2bb65de..da8b551 100644 --- a/apps/participation/models.py +++ b/apps/participation/models.py @@ -222,7 +222,7 @@ class Tournament(models.Model): return reverse_lazy("participation:tournament_detail", args=(self.pk,)) def __str__(self): - return repr(self) + return self.name class Meta: verbose_name = _("tournament") diff --git a/apps/participation/tables.py b/apps/participation/tables.py index e3ebd0e..2ec2dba 100644 --- a/apps/participation/tables.py +++ b/apps/participation/tables.py @@ -28,17 +28,26 @@ class TeamTable(tables.Table): # noinspection PyTypeChecker class ParticipationTable(tables.Table): name = tables.LinkColumn( - 'participation:participation_detail', - args=[tables.A("id")], - verbose_name=lambda: _("name").capitalize(), + 'participation:team_detail', + args=[tables.A("team__id")], + verbose_name=_("name").capitalize, accessor="team__name", ) trigram = tables.Column( - verbose_name=lambda: _("trigram").capitalize(), + verbose_name=_("trigram").capitalize, accessor="team__trigram", ) + valid = tables.Column( + verbose_name=_("valid").capitalize, + accessor="valid", + empty_values=(), + ) + + def render_valid(self, value): + return _("Validated") if value else _("Validation pending") if value is False else _("Not validated") + class Meta: attrs = { 'class': 'table table condensed table-striped', diff --git a/apps/participation/templates/participation/team_detail.html b/apps/participation/templates/participation/team_detail.html index f7cba26..25eb3e9 100644 --- a/apps/participation/templates/participation/team_detail.html +++ b/apps/participation/templates/participation/team_detail.html @@ -40,17 +40,41 @@ {% endfor %} -