示例#1
0
文件: app.py 项目: shernandezp/python
def hello():
    userAccess = UserAccess()
    if request.method == 'POST':
        result = request.form
        newUser = User()

        for key, value in result.items():
            if key == "txtname":
                newUser.username = value
            elif key == "txtpass":
                newUser.password = value
            elif key == "txtemail":
                newUser.email = value
        userAccess.InsertUser(newUser)

    users = userAccess.GetUsers()
    return render_template("index.html", users=users)
示例#2
0
文件: app.py 项目: shernandezp/python
def get_users():
    userAccess = UserAccess()
    users = userAccess.GetUsers()
    return JSONEncoder().encode(users)