title: How to sum the quantity grouped by more than one field?
body: <p>How do i sum the 'qty' field grouped by [pid][sid][eid][dbid] fields:</p>
  
  <pre><code>d = [
     {'pid': 146, 'sid': 6, 'eid': 6212, 'dbid': 1, 'qty': 10},
     {'pid': 146, 'sid': 6, 'eid': 6212, 'dbid': 1, 'qty': 20},
     {'pid': 232, 'sid': 56, 'eid': 6212, 'dbid': 1, 'qty': 1},
     {'pid': 232, 'sid': 56, 'eid': 6212, 'dbid': 1, 'qty': 1},
     {'pid': 146, 'sid': 56, 'eid': 6212, 'dbid': 1, 'qty': 100},
     {'pid': 146, 'sid': 56, 'eid': 6212, 'dbid': 1, 'qty': 100},
     ]
  
  # non-working code
  sum_of_qty = []
  for row in d:
      sum_of_qty[[row['pid']][row['sid']][row['eid']][row['dbid']]] += row['qty'] 
  </code></pre>
  
  <p>This is the final result i want:</p>
  
  <pre><code>sum_of_qty = [
      {'pid': 146, 'sid': 6, 'eid': 6121, 'dbid': 1, 'qty': 30},
      {'pid': 232, 'sid': 56, 'eid': 6121, 'dbid': 1, 'qty': 2},
      {'pid': 146, 'sid': 56, 'eid': 6121, 'dbid': 1, 'qty': 200}
      ]
  </code></pre>