摘要:
聚合查询 group by 整表聚合 In [1]: from django.db.models import * In [2]: from bookstore.models import Book In [3]: b1=Book.objects.aggregate(res=Count('price 阅读全文
摘要:
应用场景(F标记字段而非取值) 资源竞争的情况,F对象可以解决并发问题 字段之间的比较 In [1]: from bookstore.models import Book In [2]: from django.db.models import F In [3]: book=Book.objects 阅读全文