def reg_update(phone): user = User.query.get(phone) user_id = request.form['user_id'] user_type = request.form['user_type'] name = request.form['name'] phone = request.form['phone'] is_otp_verified = int(request.form['is_otp_verified']) address_id = request.form['address_id'] email = request.form['email'] is_email_verified = int(request.form['is_email_verified']) password = request.form['password'] area = request.form['area'] user.user_id = user_id user.user_type = user_type user.name = name user.phone = phone user.is_otp_verified = is_otp_verified user.address_id = address_id user.email = email user.is_email_verified = is_email_verified user.password = password user.area = area db.session.commit() return user_schema.jsonify(user)
def add_user(): password = request.json['password'] email = request.json['emailid'] user_type = request.json['user_type'] new_user = User(password, email, user_type) db.session.add(new_user) db.session.commit() return user_schema.jsonify(new_user)
def user_update(id): username = request.form['username'] email = request.form['email'] userfirstname = request.form['userfirstname'] userlastname = request.form['userlastname'] userphone = request.form['userphone'] userpass = request.form['userpass'] user.email = email user.username = username user.userfirstname = userfirstname user.userlastname = userlastname user.userphone = userphone user.userpass = userpass db.session.commit() return user_schema.jsonify(user)
def reg_update(phone): user = User.query.get(phone) user_id = request.json['user_id'] user_name = request.json['user_name'].encode('ascii', 'ignore') phone = request.json['phone'].encode('ascii', 'ignore') wallet_add = request.json['wallet_add'].encode('ascii', 'ignore') password = request.json['password'].encode('ascii', 'ignore') type_s = request.json['type_s'].encode('ascii', 'ignore') user.user_id = user_id user.user_name = user_name user.phone = phone user.wallet_add = wallet_add user.password = password user.type_s = type_s db.session.commit() return user_schema.jsonify(user)
def reg_detail(phone): user = User.query.get(phone) return user_schema.jsonify(user)
def tables_delete(id): tables = Tables.query.get(id) db.session.delete(tables) db.session.commit() return user_schema.jsonify(tables)
def user_delete(id): user = User.query.get(id) db.session.delete(user) db.session.commit() return user_schema.jsonify(user)
def user_detail(id): user = User.query.get(id) return user_schema.jsonify(user)
def waiter_delete(id): waiter = Waiter.query.get(id) db.session.delete(waiter) db.session.commit() return user_schema.jsonify(waiter)
def waiter_detail(id): waiter = Waiter.query.get(id) return user_schema.jsonify(waiter)
def cook_delete(id): cook = Cook.query.get(id) db.session.delete(cook) db.session.commit() return user_schema.jsonify(cook)
def show_user(email): user = User.query.filter_by(email=email).first_or_404() return user_schema.jsonify(user)
def searchUser(user_name): user = User.query.filter_by(user_name=user_name).first() return user_schema.jsonify(user)