No problem. On second thought, even better:

grand_total=sum(item.promotion_price*session.order[item.id] for item in 
*db(db.product.id.belongs(*session.order.keys())&(db.product.promotion_price>0)).select(db.product.id,db.product.promotion_price))




On Sunday, 28 April 2013 14:01:21 UTC-5, 黄祥 wrote:
>
> thank you so much for your detail explanation, massimo
>
> grand_total=sum(item.promotion_price*session.order[item.id] for item in 
> *db(db.product.id.belongs(*session.order.keys())&(db.product.promotion_price>0)).select())
>>
>> (one single query)
>>
>>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to