From 904f476b1cb17f83a369e1b03440b00809535fc1 Mon Sep 17 00:00:00 2001 From: emkael Date: Tue, 1 Aug 2017 02:35:02 +0200 Subject: Playoff phase is now also stored as DTO, arbitrary setting reads factored out of content generator --- jfr_playoff/data.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'jfr_playoff/data.py') diff --git a/jfr_playoff/data.py b/jfr_playoff/data.py index 6c3f0ed..2a965d1 100644 --- a/jfr_playoff/data.py +++ b/jfr_playoff/data.py @@ -19,15 +19,18 @@ class PlayoffData(object): phase_count = len(phase['matches']) if 'dummies' in phase: phase_count += len(phase['dummies']) - phase_grid = [None] * phase_count + phase_object = Phase() + phase_object.title = phase['title'] + phase_object.link = phase['link'] + phase_object.matches = [None] * phase_count phase_pos = 0 for match in phase['matches']: if 'dummies' in phase: while phase_pos in phase['dummies']: phase_pos += 1 - phase_grid[phase_pos] = match['id'] + phase_object.matches[phase_pos] = match['id'] phase_pos += 1 - grid.append(phase_grid) + grid.append(phase_object) return grid def fill_match_info(self): -- cgit v1.2.3