summaryrefslogtreecommitdiff
path: root/playoff.py
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2017-02-27 13:25:07 +0100
committeremkael <emkael@tlen.pl>2017-02-27 13:25:07 +0100
commit564b630b2699eb57524dd332c3bd4a0f910044ca (patch)
tree6aff7a559e170a5cff2e872e69197a81366365ef /playoff.py
parent94a98d21431d6ae03b81cf76c16c8ee3ce7f8b46 (diff)
Filling matches from RR places
Diffstat (limited to 'playoff.py')
-rw-r--r--playoff.py15
1 files changed, 10 insertions, 5 deletions
diff --git a/playoff.py b/playoff.py
index 578f29b..3294875 100644
--- a/playoff.py
+++ b/playoff.py
@@ -141,21 +141,26 @@ def get_match_info(match):
elif isinstance(match['teams'][i], list):
info.teams[i].name = '<br />'.join(match['teams'][i])
else:
- teams = []
+ match_teams = []
if 'winner' in match['teams'][i]:
- teams += [
+ match_teams += [
match_info[winner_match].winner
for winner_match in match['teams'][i]['winner']
]
if 'loser' in match['teams'][i]:
- teams += [
+ match_teams += [
match_info[loser_match].loser
for loser_match in match['teams'][i]['loser']
]
+ if 'place' in match['teams'][i]:
+ match_teams += [
+ teams[place-1][0]
+ for place in match['teams'][i]['place']
+ ]
info.teams[i].name = '<br />'.join([
team if team is not None else '??'
- for team in teams]
- ) if len([team for team in teams if team is not None]) > 0 else ''
+ for team in match_teams]
+ ) if len([team for team in match_teams if team is not None]) > 0 else ''
try:
towels = db_fetch(match['database'], p_sql.TOWEL_COUNT, (match['table'], match['round']))