[Flask] Creating a bootstrap table with values from mysql using flask

Oleksandr Chalyi kerriden1 at gmail.com
Tue Apr 19 11:31:54 EDT 2016


update the following function to:


   1. @app.route("/viewSingle", methods=['POST','GET'])
   2. def SingleView():
   3.     data = []
   4.     if request.method=="POST":
   5.         if request.form['submit']=="View CONTINENT":
   6.             c,conn = connection()
   7.             c.execute('''select * from Country''')
   8.             data = c.fetchall ()
   9.             c.close ()
   10.             conn.close ()
   11.     return render_template("view.html",data=data)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/flask/attachments/20160419/f4d1a484/attachment-0001.html>


More information about the Flask mailing list