对于单个记录更新,我尝试了以下代码并且它正在运行.
uid=1
info = Info.query.filter_by(id=uid).first()
info.sold_status ='1'
db.session.add(info)
db.session.commit()
现在我想为多行更新一列.
我试过了:
for row in db.session.query(Uninstall.status).all():
print row.status
abc=row.status
abc=uid
db.session.add(row.status)
db.session.commit()
但它不起作用.
提前致谢 :)
最佳答案
for row in Uninstall.query.all():
print row.status
row.status =