From c2c7ff144f6f7e555459ab52f04fb65c2cbd6af2 Mon Sep 17 00:00:00 2001 From: Patrick McMichael Date: Mon, 14 Jan 2019 20:48:41 +0000 Subject: [PATCH] Fix csv standings --- soccer/writers.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/soccer/writers.py b/soccer/writers.py index 8357e36..ca76ce9 100644 --- a/soccer/writers.py +++ b/soccer/writers.py @@ -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):