Added all user API
This commit is contained in:
parent
7f8e6c4a04
commit
0ce0da78d2
1 changed files with 4 additions and 0 deletions
4
user.py
4
user.py
|
@ -35,3 +35,7 @@ def get_user(id):
|
||||||
@app.route("/users/")
|
@app.route("/users/")
|
||||||
def all_users():
|
def all_users():
|
||||||
return render_template("allusers.html", data=[user.to_obj() for user in User.query.all()])
|
return render_template("allusers.html", data=[user.to_obj() for user in User.query.all()])
|
||||||
|
|
||||||
|
@app.route("/all")
|
||||||
|
def all_users_json():
|
||||||
|
return json.dumps([user.to_obj() for user in User.query.all()])
|
||||||
|
|
Loading…
Reference in a new issue