i've tried it but returned an error : expr = (db.dvd.acquisition_price * db.rent_detail.quantity).sum() # you can build any expression! grand_total = db(db.rent_detail.id.belongs(ids))(db.dvd.id == db.rent_detail.dvd).select(expr).first()[expr] *Traceback :* table.grand_total.represent = lambda grand_total, field: format(grand_total, ",d") ValueError: Unknown format code 'd' for object of type 'str'
i think the above code is work (the row status of rent detail is change), since i can't access the database adminstration for table compensation with the same error too. expr = (db.dvd.acquisition_price * db.rent_detail.quantity).sum() # you can build any expression! total = db(db.rent_detail.id.belongs(ids))(db.dvd.id == db.rent_detail.dvd).select(expr).first()[expr] grand_total = int(total) *Traceback :* grand_total = int(total) TypeError: int() argument must be a string or a number, not 'NoneType' my suspect is ids can not work on belongs, since it passed from selectable values from 2 previous function. 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.