Created
June 25, 2013 18:46
-
-
Save qpfiffer/5861165 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
reduce(lambda accum, val: dict(accum.items() + {val[0]: accum.get(val[0], 0) + val[1]}.items()), [(route.code, drop.customer_set.count()) for route in Route.objects.all() for drop in route.drop_points.filter(active=True)], {}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment