def flumride_teams(): teams = db.session.query(Team) has_payed_arg = request.args.get('has_payed') if has_payed_arg is not None: has_payed = has_payed_arg == 'True' teams = teams.filter_by(has_payed=has_payed) ticket_info = [{ 'type': ticket_type['name'], 'count': TeamMember.ticket_count_by_type(index) } for index, ticket_type in enumerate(app.config['FLUMRIDE'] ['ticket_types'])] total = { 'teams': teams.count(), 'members': db.session.query(TeamMember).count(), 'ticket_info': ticket_info, 'non_members_sfs': TeamMember.not_sfs_count() } return render_template("flumride/teams.html", teams=teams, total=total, has_payed=has_payed_arg)
def get_number_of_non_sfs_left(): max_nr_of_not_sfs = app.config['FLUMRIDE']['MAX_NR_OF_NOT_SFS'] nr_of_not_sfs = TeamMember.not_sfs_count() return max_nr_of_not_sfs - nr_of_not_sfs