Exemplo n.º 1
0
 def put(self, id):
     data = request.get_json()
     user = UserModel.find_by_id(id)
     user.username = data["username"]
     user.password = data["password"]
     db.session.add(user)
     db.session.commit()
     return user.json()
Exemplo n.º 2
0
 def delete(self, id):
     user = UserModel.find_by_id(id)
     db.session.delete(user)
     db.session.commit()
     return user.json()
Exemplo n.º 3
0
 def get(self, id):
     user = UserModel.find_by_id(id)
     return user.json()