Advertisement
Guest User

asssdf

a guest
Sep 24th, 2019
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. @app.route('/seepati', methods=['POST', 'GET'])
  2. def seepati():
  3.     if 'username' in session:
  4.         muser = session['username']
  5.         mans = mongo.db.mans
  6.         tresult = mongo.db.tresult
  7.         a = mans.find_one({'especialista':muser})
  8.         if a:
  9.             saida = a['username']
  10.             tresult = tresult.find({'username':saida})
  11.             output = []
  12.             for t in tresult:
  13.                 output.append({'username':t['username'], 'data':t['data']})
  14.             return jsonify({'result': output})
  15.         else:
  16.             return redirect(url_for('deuerrado'))
  17.     return render_template('index.html')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement