I was able to calculate and set some values in the database with compute=lambda r: but when i try to update those entries with SQLFORM() i get an error in the form and nothing is saved! What could be causing this and how can i fix it?
*MODEL:* db.define_table('ClientDetails', Field('CheckIn', 'date', label=SPAN('Check-In Date', _style="font-weight: bold;")), Field('CheckOut', 'date', label=SPAN('Check-Out Date', _style="font-weight: bold;")), Field('Days', compute=lambda r: (r['CheckOut']-r['CheckIn' ]).days), Field('Amount', compute=lambda r: r['Days']*r[ 'Number_of_Guests']*650)) *UPDATE CONTROLLER:* def clientUpdate(): details=db.ClientDetails(request.args(0, cast=int)) form=SQLFORM(db.ClientDetails, details.id, deletable=True, showid=False ).process() return locals() Regards: Mostwanted -- 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/d/optout.