Esempio n. 1
0
def insertUser(username, password):
    """
    注册验证
    :param username: 用户输入的用户名
    :param password: 用户输入的密码
    :return: 返回注册结果
    """
    n_list = []
    try:
        if username and password:
            uname = session.query(model.User.username).all()
            for i in uname:
                n_list += [i.username]
            if username in n_list:
                return 'fail'
            else:
                session.add(model.User(username=username, password=password))
                session.commit()
                session.close()
                return 'success'
        else:
            return 'empty'

    except:
        return 'fail'
Esempio n. 2
0
def addUser(username, password, xm, gender, qq, email, address, phone, tid):
    try:
        session.add(
            model.User(username=username,
                       password=password,
                       xm=xm,
                       gender=gender,
                       qq=qq,
                       email=email,
                       address=address,
                       phone=phone,
                       tid=tid))
        session.commit()
    except Exception as e:
        print(e)
    finally:
        session.close()
Esempio n. 3
0
def insertUser(username, password):
    result = session.add(model.User(username=username, password=password))
    session.commit()
    session.close()
    print(result)
Esempio n. 4
0
def insertUser(username, password):
    Session.add(model.User(name=username, password=password))
    Session.commit()
    Session.close()
Esempio n. 5
0
def insertUser(name, pwd):
    session.add(model.User(username=name, password=pwd))
    session.commit()
    session.close()
Esempio n. 6
0
def insertUser (username,password,email):
    result=session.add(mo.User(username=username,password=password,email=email))
    session.commit()
    session.close()