Add ability to choose graphs to render, speed by default
This commit is contained in:
7
app.py
7
app.py
@@ -157,6 +157,13 @@ def workout(user_id, workout_id, graph_type):
|
||||
return jsonify({'message': 'Workout {} not found for user {}.'.format(workout_id, user_id)}), 404
|
||||
|
||||
|
||||
@app.route('/user/<int:user_id>/workout/<int:workout_id>/view', methods=['GET'])
|
||||
def view_workout(user_id, workout_id):
|
||||
workout = Workout.query.filter_by(user_id=user_id, id=workout_id).first()
|
||||
graph_types = request.args.getlist('graph_types')
|
||||
return render_template('workout_view.html', workout=workout, graph_types=graph_types)
|
||||
|
||||
|
||||
@app.route('/user/<int:user_id>/workout/<int:workout_id>/delete', methods=['DELETE'])
|
||||
def delete_workout(user_io, workout_id):
|
||||
# Delete the workout and its associated cadence readings
|
||||
|
||||
Reference in New Issue
Block a user