I'm working with flask and handsontable. I'm interested in dynamically creating data and then passing it to a view for display with handsontable.
So far I have :
@app.route('/mv')
def my_view():
pq = my_object()
for p in pq:
print str(p._data)
return render_template('my_view.html', page_title = 'nothing yet')
if __name__ == '__main__':
app.run()
The print statement generates a dictionary of keys values for each object that looks like:
{u': False, 'delete_at': 1438759341.674, 'id': 43, 'fa': 0, 'created_at': 1438701741.674 }
{u': False, 'delete_at': 1438759341.675, 'id': 44, 'fa': 0, 'created_at': 1438701741.675 }
{u': False, 'delete_at': 1438759341.675, 'id': 47, 'fa': 0, 'created_at': 1438701741.675 }
I'd like to pass this data in to the view, preferably as JSON. How can I do this?