标签:print log comm com int class password 删除 9.png
增加:
user =
db.session.add(user)
db.session.commit()
#增加 user = User(username =‘JACKSON‘,password=‘0328‘ ) db.session.add(user) db.session.commit()
查询:
User.query.filter(User.username == ‘mis1114‘).first()
#查询 user=User.query.filter(User.username ==‘JACKSON‘).first() print(user.username,user.password)
修改:
user.password = ‘111111‘
db.session.commit()
#修改 user=User.query.filter(User.username ==‘JACKSON‘).first() user.password=‘0116‘ db.session.commit()
删除:
db.session.delete(user)
db.session.commit()
#删除 user=User.query.filter(User.username ==‘JACKSON‘).first() db.session.delete(user) db.session.commit()
标签:print log comm com int class password 删除 9.png
原文地址:http://www.cnblogs.com/JaTae/p/7852667.html