# 一对一增加
# create_obj = models.authorDetail.objects.create(
# birthday = '2001-01-01',
# telephone='010200',
# addr='山西临汾',
# )
# 方式一
# models.author.objects.create(
# name='张三',
# age = '18',
# authorDetail=create_obj,
# )
# obj = models.authorDetail.objects.filter(addr="山西临汾").first()
# # 方式二 没成功
# models.author.objects.create(
# name='李四',
# age = '19',
# authorDetail_id=obj.id,
# )
# 一对多
# 方式1
# obj = models.Publish.objects.get(id=1)
# models.Books.objects.create(
# title='Linux从入门到精通',
# publisdate='2021-10-01',
# price='99.99',
# publishs=obj,
# )
# obj = models.Publish.objects.get(id=1)
# models.Books.objects.create(
# title='Django入门到精通',
# publisdate='2021-10-01',
# price='99.99',
# publishs_id=obj.id,
# )
# 多对多
# book_obj = models.Books.objects.get(bid=1)
# book_obj.authors.add(*[1,2])