|
|
|
|
@ -337,8 +337,6 @@ class Tournament(models.Model): |
|
|
|
|
|
|
|
|
|
def create_match_group(self, name, matches, broadcasted): |
|
|
|
|
matches = list(matches) |
|
|
|
|
# if not broadcasted: |
|
|
|
|
# matches = [m for m in matches if m.should_appear()] |
|
|
|
|
matches.sort(key=lambda m: m.index) |
|
|
|
|
live_matches = [match.live_match() for match in matches] |
|
|
|
|
return MatchGroup(name, live_matches) |
|
|
|
|
@ -452,15 +450,14 @@ class Tournament(models.Model): |
|
|
|
|
return matches[0] |
|
|
|
|
|
|
|
|
|
def round_for_index(self, index): |
|
|
|
|
return self.round_set.filter(index=index,parent=None).first() |
|
|
|
|
return self.round_set.filter(index=index, parent=None).first() |
|
|
|
|
|
|
|
|
|
def group_stages_matches(self): |
|
|
|
|
matches = [] |
|
|
|
|
for group_stage in self.groupstage_set.all(): |
|
|
|
|
matches.extend(group_stage.match_set.all()) |
|
|
|
|
matches = [m for m in matches if m.should_appear()] |
|
|
|
|
# matches = [m for m in matches if m.start_date] |
|
|
|
|
matches.sort(key=lambda m: m.start_date, reverse=True) |
|
|
|
|
matches.sort(key=lambda m: (m.non_null_start_date(), m.index), reverse=True) |
|
|
|
|
return matches |
|
|
|
|
|
|
|
|
|
def display_rankings(self): |
|
|
|
|
|