diff --git a/tournaments/admin.py b/tournaments/admin.py index 6656fa3..75db01c 100644 --- a/tournaments/admin.py +++ b/tournaments/admin.py @@ -61,10 +61,10 @@ class TeamScoreAdmin(SyncedObjectAdmin): search_fields = ['id'] class RoundAdmin(SyncedObjectAdmin): - list_display = ['tournament', 'name', 'index', 'parent'] + list_display = ['tournament', 'name', 'parent', 'index'] list_filter = [SimpleTournamentListFilter, SimpleIndexListFilter] search_fields = ['id'] - ordering = ['parent'] + ordering = ['parent', 'index'] class PlayerRegistrationAdmin(SyncedObjectAdmin): list_display = ['first_name', 'last_name', 'licence_id', 'rank'] @@ -75,7 +75,7 @@ class PlayerRegistrationAdmin(SyncedObjectAdmin): class MatchAdmin(SyncedObjectAdmin): list_display = ['__str__', 'round', 'group_stage', 'start_date', 'end_date', 'index'] list_filter = [MatchTypeListFilter, MatchTournamentListFilter, SimpleIndexListFilter] - ordering = ['-group_stage', 'round'] + ordering = ['-group_stage', 'round', 'index'] class GroupStageAdmin(SyncedObjectAdmin): list_display = ['tournament', 'start_date', 'index'] diff --git a/tournaments/models/match.py b/tournaments/models/match.py index 1346b42..b450e35 100644 --- a/tournaments/models/match.py +++ b/tournaments/models/match.py @@ -34,7 +34,10 @@ class Match(SideStoreModel): def __str__(self): names = " / ".join(self.player_names()) - return f"{self.stage_name()} #{self.index}: {names}" + if names: + return f"{self.stage_name()} : {names}" + else: + return f"{self.stage_name()}" def save(self, *args, **kwargs): self.store_id = str(self.get_tournament_id())