Home > other >  Django how to aggregate the same field?
Django how to aggregate the same field?

Time:10-05

{' 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}] & gt;

This is a table, I want to have every content_type and object_id equal count value addition, such as yellow, are content_type: 9 object_id: 11, all together to count the 20 + 7=27


It can use aaggregate implementation? The small white,
  • Related