def entries(): users = User.query.all() users.sort(key=lambda x: x.firstname, reverse=False) master = score_scraper.get_master_bracket() score = scoring.score(master, users) order = scoring.order(score) rank = scoring.rank(order, score) bracket_teams = score_scraper.get_bracket_teams() if current_user.is_authenticated: user_id = request.args.get('id', default=current_user.id, type=int) else: user_id = request.args.get('id', default=1, type=int) elim = score_scraper.get_elim() game_scores = score_scraper.get_scoreticker_json() if user_id == -1 or User.query.get(user_id).round1 is None: display = [] else: display = User.query.get(user_id).round1.replace('"', '').replace( '[', '').replace(']', '').split(',') return render_template('entries.html', users=users, display=display, master=master, elim=elim, user_id=user_id, User=User, order=order, Users=users, rank=rank, matches=game_scores, teams=bracket_teams)
def index(): inv_map = score_scraper.ncaa_to_id() master = score_scraper.get_master_bracket() elim = score_scraper.get_elim() users = User.query.all() scoring.convert_brackets_to_id(inv_map, users, master) end_rounds = scoring.get_end_rounds(users) score = scoring.score(master, users) order = scoring.order(score) rank = scoring.rank(order, score) potential = scoring.potential(elim, users, master) game_scores = score_scraper.get_scoreticker_json() seo = score_scraper.convert_short_to_seo() return render_template('index.html', users=users, score=score, potential=potential, end_rounds=end_rounds, elim=elim, order=order, rank=rank, User=User, master=master, matches=game_scores, seo=seo)
def master(): game_scores = score_scraper.get_scoreticker_json() display = score_scraper.get_master_bracket() bracket_teams = score_scraper.get_bracket_teams() return render_template('master.html', display=display, matches=game_scores, teams=bracket_teams)
def bracketEntry(): game_scores = score_scraper.get_scoreticker_json() bracket_teams = score_scraper.get_bracket_teams() if current_user.is_authenticated: return render_template("bracketEntry.html", matches=game_scores, teams=bracket_teams) else: return login()
def matches(): users = User.query.all() rounds = [] for user in users: display = [''] if user.round1 is not None: display = user.round1.replace('"', '').replace('[', '').replace( ']', '').split(',') rounds.append(display) game_scores = score_scraper.get_scoreticker_json() game_id = request.args.get('id', default=1, type=int) game_data = score_scraper.get_game_data() game_id_selection = score_scraper.convert_ncaa_to_master( game_data[game_id][3]) return render_template('matches.html', users=users, matches=game_scores, game_id=game_id, game_data=game_data, game_selected=game_id_selection, rounds=rounds)
def possibilities(): game_scores = score_scraper.get_scoreticker_json() return render_template("possibilities.html", matches=game_scores)
def past_winners(): game_scores = score_scraper.get_scoreticker_json() return render_template('past_winners.html', matches=game_scores)
def stats(): game_scores = score_scraper.get_scoreticker_json() return render_template('stats.html', matches=game_scores)