|
|
|
|
@ -125,7 +125,8 @@ class Match(models.Model): |
|
|
|
|
scores = team_score.scores_array() |
|
|
|
|
weight = team_score.team_registration.weight() |
|
|
|
|
is_winner = team_score.team_registration.id == self.winning_team_id |
|
|
|
|
team = Team(image, names, scores, weight, is_winner) |
|
|
|
|
walk_out = team_score.walk_out |
|
|
|
|
team = Team(image, names, scores, weight, is_winner, walk_out) |
|
|
|
|
livematch.add_team(team) |
|
|
|
|
|
|
|
|
|
return livematch |
|
|
|
|
@ -147,13 +148,14 @@ class Match(models.Model): |
|
|
|
|
# return sort_score |
|
|
|
|
|
|
|
|
|
class Team: |
|
|
|
|
def __init__(self, image, names, scores, weight, is_winner): |
|
|
|
|
def __init__(self, image, names, scores, weight, is_winner, walk_out): |
|
|
|
|
# print(f"image = {image}, names= {names}, scores ={scores}, weight={weight}, win={is_winner}") |
|
|
|
|
self.image = image |
|
|
|
|
self.names = names |
|
|
|
|
self.scores = scores |
|
|
|
|
self.weight = weight |
|
|
|
|
self.is_winner = is_winner |
|
|
|
|
self.walk_out = walk_out |
|
|
|
|
|
|
|
|
|
def to_dict(self): |
|
|
|
|
return { |
|
|
|
|
@ -162,6 +164,7 @@ class Team: |
|
|
|
|
"scores": self.scores, |
|
|
|
|
"weight": self.weight, |
|
|
|
|
"is_winner": self.is_winner, |
|
|
|
|
"walk_out": self.walk_out, |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
class LiveMatch: |
|
|
|
|
|