django的orm作为简单查询 使用简直是太爽了,所见即所得,但是groupby时候缺有一些坑点
from django.db.models import Count from w.models import www # 在不加order by的时候 会默认按照id分组 print(TaskPort.objects.annotate(service_count=Count("service")
因篇幅问题不能全部显示,请点此查看更多更全内容