摘要: #########################聚合#################################查询所有书籍的价格和 字典ret = Book.objects.all().aggregate(price_sum=Sum("price"))print(ret) # 查询所有作者 阅读全文
posted @ 2018-10-06 17:26 fangsheng420 阅读(153) 评论(0) 推荐(0) 编辑
摘要: #########################基于对象查询(子查询)############################ 按字段(publish) 1) 一对多 : book > publish < book_set.all() 正向查询按字段:查询python这本书籍的出版社的邮箱 pyt 阅读全文
posted @ 2018-10-06 14:37 fangsheng420 阅读(90) 评论(0) 推荐(0) 编辑