Do you lambda is more complicated than what you show? If all the field
required for the lambda to compute are not available it failed silently.

For example :

db.tab.field_computed.compute=lambda record: record.field1+record.field2

If field1 or field2 is not available the computation will not work.

Richard

On Fri, May 25, 2012 at 4:45 PM, peter <[email protected]> wrote:

> Thanks I should have used update_record. However still no compute, and
> compute does not work when editing also.
> Peter
>
>
> On Friday, May 25, 2012 6:50:33 PM UTC+1, peter wrote:
>>
>> I am using web2py 1.99.7
>>
>> I have a compute as
>>
>> db.image.thumb.compute=lambda r:THUMB(r['file'])
>>
>>
>> I update the whole database
>>
>> def update_images():
>>     rows=db(db.image).select()
>>     for row in rows:
>>         row.update(title=row.title)
>>     db.commit()
>>
>>
>> Yet, the computes have not occurred.
>>
>> Similarly if I edit a record and submit, no compute. Yet if I add a
>> record, the compute does take place.
>>
>> Anyone any ideas why?
>>
>> Thanks
>> Peter
>>
>

Reply via email to