daily pastebin goal
40%
SHARE
TWEET

Untitled

a guest Dec 22nd, 2017 58 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. def createuser(request):
  2.    file = request.files['aadharimage']
  3.    if file.filename == None:
  4.        flash('No selected file')
  5.        return redirect(request.url)
  6.    filename=''
  7.    if file:
  8.       filename = secure_filename(file.filename)
  9.       file.save(os.path.join(app.config['UPLOAD_FOLDER'], filename))
  10. users= Enduser(name=request.form["name"],fathername=request.form['fathername'],password=request.form["password"], aadhar_image=filename,email=request.form["email"],address=request.form["address"],type=request.form["type"],location_id=request.form["location_id"],mobile=request.form['mobile'],usertype=request.form['usertype'],lastlogin=request.form['lastlogin'],companyname=request.form['companyname'])
  11.  
  12. sqlsession.add(users)
  13. sqlsession .commit()
  14.  
  15. @app.route ('/page/newuser')
  16. def pagenewuser():
  17.    if session['username']:
  18.       return render_template("newuser.html", user session['username'],Locations=getlocation().all())
  19.   else:
  20.      flash('Please Login first!!')
  21.      return main()
  22.  
  23. @app.route('/page/edituser')
  24. def pageedituser():
  25.    if session['username']:
  26.       users = getusers()
  27.    if users.first()== None:
  28.       return render_template("empty.html", user=session['username'])
  29.   else:
  30.      return render_template("edituser.html",  user=session['username'], endusers=users.all() )
  31.    
  32. <td>{{Values.id}}</td>
  33. <td>{{Values.name}}</td>
  34. <td>{{Values.fathername}}</td>
  35. <td><img src="{{url_for('static',filename='assets/images/{{Values.aadhar_image}}')}}" alt="sample"  width="25" height="24"/></td>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top