dimagi/rapidsms-logistics — pull request #8 by mlavin (2012-12-17 20:44:53+00:00)
Title: Reduce Queries in Email Summary View

The summary view was calling `location.stockout_count` etc which was in turn calling `_get_stock_count` which called `_get_stock_count_for_facilities` while running a query for all the child facilities. Since we already have the set of facilities this significantly reduces the number of queries inside the loop by passing this list directly to `_get_stock_count_for_facilities`.