api_w.py 363 B

12345678910111213
  1. from .tool.func import *
  2. def api_w_2(conn, name):
  3. curs = conn.cursor()
  4. curs.execute("select data from data where title = ?", [name])
  5. data = curs.fetchall()
  6. if data:
  7. json_data = { "title" : name, "data" : render_set(title = name, data = data[0][0]) }
  8. return flask.jsonify(json_data)
  9. else:
  10. return flask.jsonify({})