2016-01-18 06:41:11 +00:00
|
|
|
from flask import Blueprint, request, session
|
|
|
|
from flask import current_app as app
|
|
|
|
|
|
|
|
from decorators import api_wrapper
|
|
|
|
|
|
|
|
import team
|
|
|
|
|
|
|
|
blueprint = Blueprint("stats", __name__)
|
|
|
|
|
|
|
|
@blueprint.route("/scoreboard")
|
|
|
|
@api_wrapper
|
|
|
|
def all_teams_stats():
|
|
|
|
teams = team.get_team().all()
|
|
|
|
result = [ ]
|
2016-01-27 02:30:30 +00:00
|
|
|
count = 0
|
2016-01-18 06:41:11 +00:00
|
|
|
for _team in teams:
|
2016-01-27 02:30:30 +00:00
|
|
|
count += 1
|
2016-01-18 06:41:11 +00:00
|
|
|
result.append({
|
2016-01-27 02:30:30 +00:00
|
|
|
"rank": count,
|
2016-01-18 06:41:11 +00:00
|
|
|
"teamname": _team.teamname,
|
|
|
|
"tid": _team.tid,
|
|
|
|
"school": _team.school,
|
|
|
|
"points": _team.points()
|
|
|
|
})
|
|
|
|
return { "success": 1, "scoreboard": result }
|