Skip to content

Commit

Permalink
Fix csv standings
Browse files Browse the repository at this point in the history
  • Loading branch information
Saturn committed Jan 14, 2019
1 parent b8d41df commit c2c7ff1
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions soccer/writers.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,10 +255,14 @@ def standings(self, league_table, league):
headers = ['Position', 'Team Name', 'Games Played', 'Goal For',
'Goals Against', 'Goal Difference', 'Points']
result = [headers]
result.extend([team['position'], team['teamName'], team['playedGames'],
team['goals'], team['goalsAgainst'],
team['goalDifference'], team['points']]
for team in league_table['standing'])
result.extend([team['position'],
team['team']['name'],
team['playedGames'],
team['goalsFor'],
team['goalsAgainst'],
team['goalDifference'],
team['points']]
for team in league_table['standings'][0]['table'])
self.generate_output(result)

def league_scores(self, total_data, time, show_upcoming, use_12_hour_format):
Expand Down

0 comments on commit c2c7ff1

Please sign in to comment.