def matches():
singles = pd.read_sql('select * from game where deleted = 0', con=engine)
doubles = pd.read_sql('select * from doubles_game where deleted = 0', con=engine)
tz = pytz.timezone('America/New_York')
for frame in [singles, doubles]:
frame['timestamp'] = frame['timestamp'].apply(datetime.utcfromtimestamp)
frame['timestamp'] = frame['timestamp'].apply(datetime.replace, tzinfo=tz)
frame['timestamp'] = frame['timestamp'].dt.strftime('%Y-%m-%d %H:%M:%S %Z')
singles = singles.to_dict('records')
doubles = doubles.to_dict('records')
return render_template('gamelog.html', singles_games=singles, doubles_games=doubles)
评论列表
文章目录