def update(self, id, first_name, last_name):
"""Update a record in the database with new values"""
query = text("""
UPDATE tblUser SET
first_name=:first_name,
last_name=:last_name
WHERE
id=:id
""")
result = self.execute(query,
id=id,
first_name=first_name,
last_name=last_name)
db.session.commit()
return result.rowcount > 0
评论列表
文章目录