<QuerySet {'count': 20, 'content_type': 9, 'object_id': 11}, {'count': 7, 'content_type': 9, 'object_id': 91}, {'count': 7, 'content_type': 9, 'object_id': 11}, {'count': 2, 'content_type': 9, 'object_id': 7}, {'count': 1, 'content_type': 9, 'object_id': 4}, {'count': 1, 'content_type': 9, 'object_id': 34}, {'count': 1, 'content_type': 9, 'object_id': 3}, {'count': 1, 'content_type': 7, 'object_id': 18}]>
這是表,我想把每個content_type和object_id相等的count值相加,比如黃色部分,都是content_type:9 object_id:11,所有把count相加20+7=27
這個可以用aaggregate實作么? 小白求教。
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/110777.html
上一篇:Python問題?_??
