def add_schedule(): teams = TeamService.get_all() if request.method == 'GET': return render_template('admin/event/add_schedule.html', teams=teams) event_id = int(request.args.get('event_id')) schedule_dict = request.form.to_dict() schedule_dict['event_id'] = event_id MatchService.add(schedule_dict) return redirect(url_for('admin.list_match_schedules', event_id=event_id))
def edit_schedule(schedule_id): event_id = request.args.get('event_id', 0) event_id = int(event_id) match = MatchService.get_one(schedule_id) teams = TeamService.get_all() default_tm = request.args.get('date') if request.method == 'GET': return render_template('admin/event/edit_schedule.html', match=match, teams=teams) schedule_dict = request.form.to_dict() MatchService.edit(schedule_id, schedule_dict) return redirect( url_for('admin.list_match_schedules', event_id=event_id, date=default_tm))
def list_player_teams(): teams = TeamService.get_all() return jsonify_with_data(APIError.OK, teams=teams)