批量删除

session.query(User).filter(User.home=='shanghai').delete()
session.commit()

批量更新

session.query(User).filter(User.home=='shanghai').update({User.login_num:0})
session.commit()
Last modification:June 6, 2022
If you think my article is useful to you, please feel free to appreciate