Add season codes and overview page.

This commit is contained in:
2019-01-12 15:02:21 +01:00
parent 30bab3e651
commit 29989b7e4e
6 changed files with 48 additions and 11 deletions

18
db.py
View File

@@ -128,13 +128,23 @@ def load_enemies(id=None):
def save_season_query(season):
if not season.id:
sql = 'insert into season values (?, ?, ?, ?, ?)'
args = (None, season.game, season.description, season.start, season.end)
sql = 'insert into season values (?, ?, ?, ?, ?, ?)'
args = (None,
season.game,
season.description,
season.start,
season.end,
season.code)
else:
sql = 'update season ' \
'set game=?, description=?, start=?, end=? ' \
'set game=?, description=?, start=?, end=?, code=? ' \
'where id==?'
args = (season.game, season.description, season.start, season.end, season.id)
args = (season.game,
season.description,
season.start,
season.end,
season.code,
season.id)
return sql, args