Skip to content

Instantly share code, notes, and snippets.

@gbozee
Created May 2, 2018 08:42
Show Gist options
  • Save gbozee/cb516b022ba4fbc865905fc38702c5b5 to your computer and use it in GitHub Desktop.
Save gbozee/cb516b022ba4fbc865905fc38702c5b5 to your computer and use it in GitHub Desktop.
Sample Question
@app.route('/aggregated-measurements')
def get_aggregated_measurements():
aggregated_measurements_objects = AggregatedMeasurement.query.first()
# this is where the breakpoint would be
import pdb; pdb.set_trace()
# transforming into JSON-serializable objects
aggregated_measurement_schema = AggregatedMeasurementSchema()
result = aggregated_measurement_schema.dump(aggregated_measurements_objects)
return jsonify(result.data)
/*
Your server should pause by the time the break point is hit and you can check if the variable is set
pdb> aggregated_measurements
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment