Adding score and place to team page, fixing create_app

This commit is contained in:
Kevin Chung
2015-03-08 13:39:22 -04:00
parent f43c695330
commit b4dd54d36a
7 changed files with 46 additions and 4 deletions

View File

@@ -106,10 +106,12 @@ def init_views(app):
def team(teamid):
user = Teams.query.filter_by(id=teamid).first()
solves = Solves.query.filter_by(teamid=teamid).all()
score = user.score()
place = user.place()
db.session.close()
if request.method == 'GET':
return render_template('team.html', solves=solves, team=user)
return render_template('team.html', solves=solves, team=user, score=score, place=place)
elif request.method == 'POST':
json = {'solves':[]}
for x in solves: