|
|
|
@ -451,6 +451,7 @@ class Tournament(models.Model): |
|
|
|
'matches': [], |
|
|
|
'matches': [], |
|
|
|
'group_stages': group_stages_dicts, |
|
|
|
'group_stages': group_stages_dicts, |
|
|
|
'summons': team_summons_dicts, |
|
|
|
'summons': team_summons_dicts, |
|
|
|
|
|
|
|
'rankings' : [] |
|
|
|
} |
|
|
|
} |
|
|
|
else: |
|
|
|
else: |
|
|
|
live_matches_dicts = [match.live_match().to_dict() for match in matches] |
|
|
|
live_matches_dicts = [match.live_match().to_dict() for match in matches] |
|
|
|
@ -458,6 +459,16 @@ class Tournament(models.Model): |
|
|
|
'matches': live_matches_dicts, |
|
|
|
'matches': live_matches_dicts, |
|
|
|
'group_stages': [], |
|
|
|
'group_stages': [], |
|
|
|
'summons': team_summons_dicts, |
|
|
|
'summons': team_summons_dicts, |
|
|
|
|
|
|
|
'rankings' : [] |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
elif self.end_date is not None: |
|
|
|
|
|
|
|
live_matches_dicts = [match.live_match().to_dict() for match in matches] |
|
|
|
|
|
|
|
team_rankings_dicts = [ranking.to_dict() for ranking in self.rankings()] |
|
|
|
|
|
|
|
return { |
|
|
|
|
|
|
|
'matches': live_matches_dicts, |
|
|
|
|
|
|
|
'group_stages': [], |
|
|
|
|
|
|
|
'summons': [], |
|
|
|
|
|
|
|
'rankings' : team_rankings_dicts |
|
|
|
} |
|
|
|
} |
|
|
|
else: # we want to display the broadcasted content |
|
|
|
else: # we want to display the broadcasted content |
|
|
|
live_matches_dicts = [match.live_match().to_dict() for match in matches] |
|
|
|
live_matches_dicts = [match.live_match().to_dict() for match in matches] |
|
|
|
@ -465,6 +476,7 @@ class Tournament(models.Model): |
|
|
|
'matches': live_matches_dicts, |
|
|
|
'matches': live_matches_dicts, |
|
|
|
'group_stages': group_stages_dicts, |
|
|
|
'group_stages': group_stages_dicts, |
|
|
|
'summons': [], |
|
|
|
'summons': [], |
|
|
|
|
|
|
|
'rankings' : [] |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
def broadcasted_matches_and_group_stages(self): |
|
|
|
def broadcasted_matches_and_group_stages(self): |
|
|
|
@ -479,19 +491,26 @@ class Tournament(models.Model): |
|
|
|
matches.extend(first_round.get_matches_recursive(True)) |
|
|
|
matches.extend(first_round.get_matches_recursive(True)) |
|
|
|
else: |
|
|
|
else: |
|
|
|
current_round = self.round_to_show() |
|
|
|
current_round = self.round_to_show() |
|
|
|
|
|
|
|
print("current_round", current_round) |
|
|
|
if current_round: |
|
|
|
if current_round: |
|
|
|
|
|
|
|
|
|
|
|
# Add full matches from the next rounds |
|
|
|
# Add full matches from the next rounds |
|
|
|
|
|
|
|
print("Add full matches from the next rounds") |
|
|
|
next_round = self.round_for_index(current_round.index - 1) |
|
|
|
next_round = self.round_for_index(current_round.index - 1) |
|
|
|
if next_round: |
|
|
|
if next_round: |
|
|
|
|
|
|
|
print("next_round", next_round) |
|
|
|
matches.extend(next_round.get_matches_recursive(True)) |
|
|
|
matches.extend(next_round.get_matches_recursive(True)) |
|
|
|
|
|
|
|
|
|
|
|
# Add matches from the previous round or group_stages |
|
|
|
# Add matches from the previous round or group_stages |
|
|
|
|
|
|
|
print("Add matches from the previous round or group_stages") |
|
|
|
previous_round = self.round_for_index(current_round.index + 1) |
|
|
|
previous_round = self.round_for_index(current_round.index + 1) |
|
|
|
if previous_round: |
|
|
|
if previous_round: |
|
|
|
|
|
|
|
print("previous_round", previous_round) |
|
|
|
|
|
|
|
print('test 1') |
|
|
|
matches.extend(current_round.get_matches_recursive(True)) |
|
|
|
matches.extend(current_round.get_matches_recursive(True)) |
|
|
|
matches.extend(previous_round.get_matches_recursive(True)) |
|
|
|
matches.extend(previous_round.get_matches_recursive(True)) |
|
|
|
else: |
|
|
|
else: |
|
|
|
|
|
|
|
print("else") |
|
|
|
matches.extend(current_round.all_matches(True)) |
|
|
|
matches.extend(current_round.all_matches(True)) |
|
|
|
group_stages = self.live_group_stages() |
|
|
|
group_stages = self.live_group_stages() |
|
|
|
|
|
|
|
|
|
|
|
|