Guest User

Untitled

a guest
Dec 10th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. @app.route('/', methods=['POST', 'GET'])
  2. def index():
  3. if (request.args['search']):
  4. tag = request.args.get("tagname")
  5. query = "select * from quote,tags,quote_tags where quote.qid =
  6. quote_tags.qid and tags.tagid = quote_tags.tagid and tagname=" + str(tag)
  7. cur = connection.execute(query)
  8. rv = cur.fetchall()
  9. cur.close()
  10. return render_template('index.html', tag=rv)
  11. else:
  12. return render_template('index.html')
Add Comment
Please, Sign In to add comment