标签:blog == 删除 技术 username 修改 print ssi query
增加:
db.session.add(user)
db.session.commit()
增加代码:
user = User(username=‘tan1997‘,password=‘19961021‘) db.session.add(user) db.session.commit()
查询:
User.query.filter(User.username == ‘mis1114‘).first()
查询代码:
user = User.query.filter(User.username == ‘tan1997‘).first() print(user.username,user.password)
修改:
user.password = ‘111111‘
db.session.commit()
修改代码:
user=User.query.filter(User.username == ‘tan1997‘).first() user.password=1234567 db.session.commit()
删除:
db.session.delete(user)
db.session.commit()
删除代码:
user=User.query.filter(User.password == ‘19961021‘).first() db.session.delete(user) db.session.commit()
标签:blog == 删除 技术 username 修改 print ssi query
原文地址:http://www.cnblogs.com/yishhaoo/p/7846182.html