from app01 import models
def rom(request):
# 增加
models.UserInfo.object.create(username='alex', password='123')
#查找
obj = models.UserInfo.object.all() #所有数据
obj = models.UserInfo.object.filter(id=1)
for i in obj:
print(i.id, i.username, i.password)
#删除
models.UserInfo.object.filter(id=2).delete()
#跟新(改)
models.UserInfo.object.filter(id=3).update(password=666)