I have run into the above as well. 

Likely the issue is that on update you are not returning all values that 
the 'compute' field is based upon. 

Ex:
db.define_table('test',
  Field('val1', 'double'),
  Field('val2', 'double'),
  Field('result',
     compute = lambda r: r['val1'] + r['val2'])
)

Now if you have one row selected with values:
id = 1,  val1 = 1,  val2 = 1,  result = 2
in variable currRow

If you do:
> currRow.update_record(val1 = 30)
This will not use the 'compute' function

Instead you need to provide all values the compute is based upon in your 
update... so we should have:
> currRow.update_record(val1 = 30, val2 = currRow.val2)

This will now perform the compute method. 

I don't know if this is by design, but looking in the DAL the issue seems 
to be that the DAL only has the field data you sent to 'update' to play 
with.  (Line 4965 of dal.py [function def_listify(self,fields,update=False) 
]. (web2py v 1.99.2)

Reply via email to