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

isaac tetteh itetteh34 at hotmail.com
Tue Apr 19 12:52:17 EDT 2016


Wow the error went away but data is empty list. I think that works but the problem is my code doesnt enter when it get to if request.form['submit'] i think i don't have correct code for that side. But how will i know if that specific button is pressed. Thanks

Sent from my iPhone

> On Apr 19, 2016, at 10:31 AM, Oleksandr Chalyi <kerriden1 at gmail.com> wrote:
> 
> update the following function to:
> 
> @app.route("/viewSingle", methods=['POST','GET'])
> def SingleView():
>     data = []
>     if request.method=="POST":
>         if request.form['submit']=="View CONTINENT":
>             c,conn = connection()
>             c.execute('''select * from Country''')
>             data = c.fetchall ()
>             c.close ()
>             conn.close ()
>     return render_template("view.html",data=data)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/flask/attachments/20160419/e4a1d2f5/attachment.html>


More information about the Flask mailing list