摘要:
常用查询 python manage.py shell from blog.models import * 查询: 1、全表查询 b = Book.objects.all() #查询第一条 b[0].title >>> b = Book.objects.all() >>> b[0].title 'p 阅读全文
摘要:
增(create , save) from app01.models import * #create方式一: Author.objects.create(name='Alvin') #create方式二(推荐): Author.objects.create(**{"name":"alex"}) # 阅读全文