|
|
|
|
@ -406,13 +406,16 @@ class Match(models.Model): |
|
|
|
|
time_indication = self.time_indication() |
|
|
|
|
court = self.court_name(self.court_index) |
|
|
|
|
group_stage_name = None |
|
|
|
|
bracket_name = None |
|
|
|
|
if self.group_stage: |
|
|
|
|
group_stage_name = self.group_stage.display_name() |
|
|
|
|
else: |
|
|
|
|
bracket_name = f"Match n˚{self.index_in_round() + 1}" |
|
|
|
|
|
|
|
|
|
ended = self.end_date is not None |
|
|
|
|
live_format = "Format " + FederalMatchCategory(self.format).format_label_short |
|
|
|
|
|
|
|
|
|
livematch = LiveMatch(self.index, title, date, time_indication, court, self.started(), ended, group_stage_name, live_format, self.start_date, self.court_index, self.disabled) |
|
|
|
|
livematch = LiveMatch(self.index, title, date, time_indication, court, self.started(), ended, group_stage_name, live_format, self.start_date, self.court_index, self.disabled, bracket_name) |
|
|
|
|
|
|
|
|
|
for team in self.live_teams(): |
|
|
|
|
livematch.add_team(team) |
|
|
|
|
@ -473,7 +476,7 @@ class Team: |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
class LiveMatch: |
|
|
|
|
def __init__(self, index, title, date, time_indication, court, started, ended, group_stage_name, format, start_date, court_index, disabled): |
|
|
|
|
def __init__(self, index, title, date, time_indication, court, started, ended, group_stage_name, format, start_date, court_index, disabled, bracket_name): |
|
|
|
|
self.index = index |
|
|
|
|
self.title = title |
|
|
|
|
self.date = date |
|
|
|
|
@ -488,6 +491,7 @@ class LiveMatch: |
|
|
|
|
self.disabled = disabled |
|
|
|
|
self.start_date = start_date |
|
|
|
|
self.court_index = court_index |
|
|
|
|
self.bracket_name = bracket_name |
|
|
|
|
|
|
|
|
|
def add_team(self, team): |
|
|
|
|
self.teams.append(team) |
|
|
|
|
@ -508,7 +512,8 @@ class LiveMatch: |
|
|
|
|
"group_stage_name": self.group_stage_name, |
|
|
|
|
"format": self.format, |
|
|
|
|
"disabled": self.disabled, |
|
|
|
|
"court_index": self.court_index |
|
|
|
|
"court_index": self.court_index, |
|
|
|
|
"bracket_name": self.bracket_name |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
def show_time_indication(self): |
|
|
|
|
|