Jun 20, 2011

Quick and pritty iteration

qs = Item.objects.filter(...).values_list('title', 'amount', 'price')

for title, amount, price in qs:
    print title, amount
    total += amount * price

No comments: