from django.contrib.auth.models import User from django.db.models import Q from django.db.models.functions import Lower from app.models import *
添加操作
a、使用create方式 方式一: Publish.objects.create("name"="人民出版社",city="北京"} 方式二: Publish.objects.create(**{"name":"文艺出版社","city":"上海"}) b、使用save方式 方式一: book1=Book(title="python",price="88",publish_id="1",publication_date="2017-06-18") book1.save() 方式二: author1=Author(name="jerry") author1.save()