The three-line function that ran a thousand queries
Here is a function. It is three lines long. It is, by any reasonable reading, fine:
def order_totals(order_ids):
orders = [Order.objects.get(id=oid) for oid in order_ids]
return sum(o.total fo
jaytank.hashnode.dev5 min read