Are you sure you are selecting records: print len(db(db.rent_detail.id.belongs(ids) ).select() )
On Thursday, 5 December 2013 15:46:01 UTC-6, 黄祥 wrote: > > hi, > > i learned from pos online store appliance about sum the session to acquire > the grand_total, when i tried to do the same to query result from other > table, is not work (no error appears, but the result always 0). > e.g. not worked > ids = request.vars.ids > grand_total = sum(item.dvd.acquisition_price * item.quantity for item in > db(db.rent_detail.id.belongs(ids) ).select(db.rent_detail.dvd, > db.rent_detail.quantity) ) > > even i put the exact number not variable, the result is same (no error > occured, but the result always 0) > e.g. not worked > ids = request.vars.ids > grand_total = sum(2 * 2 for item in db(db.rent_detail.id.belongs(ids) > ).select(db.rent_detail.dvd, db.rent_detail.quantity) ) > > is there a way i can achieve it? > > thanks and best regards, > stifan > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- 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 web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.