Esempio n. 1
0
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)
Esempio n. 2
0
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)
Esempio n. 3
0
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)
Esempio n. 4
0
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)
Esempio n. 5
0
def reg_detail(phone):
    user = User.query.get(phone)
    return user_schema.jsonify(user)
Esempio n. 6
0
def tables_delete(id):
    tables = Tables.query.get(id)
    db.session.delete(tables)
    db.session.commit()

    return user_schema.jsonify(tables)
Esempio n. 7
0
def user_delete(id):
    user = User.query.get(id)
    db.session.delete(user)
    db.session.commit()

    return user_schema.jsonify(user)
Esempio n. 8
0
def user_detail(id):
    user = User.query.get(id)
    return user_schema.jsonify(user)
Esempio n. 9
0
def waiter_delete(id):
    waiter = Waiter.query.get(id)
    db.session.delete(waiter)
    db.session.commit()

    return user_schema.jsonify(waiter)
Esempio n. 10
0
def waiter_detail(id):
    waiter = Waiter.query.get(id)
    return user_schema.jsonify(waiter)
Esempio n. 11
0
def cook_delete(id):
    cook = Cook.query.get(id)
    db.session.delete(cook)
    db.session.commit()

    return user_schema.jsonify(cook)
Esempio n. 12
0
def show_user(email):
    user = User.query.filter_by(email=email).first_or_404()
    return user_schema.jsonify(user)
Esempio n. 13
0
def searchUser(user_name):
    user = User.query.filter_by(user_name=user_name).first()
    return user_schema.jsonify(user)