tested in 2.8.2 still got the problem, about compute field during updates, 
although the update is not related with the compute field.
e.g.
update the status field on rent table, when i insert the revert / 
compensation table using after insert callback. yet the compute i use is 
for total_price field on rent table.

how can i achieve it? or is this issue is not resolve yet?

thanks and best regards,
stifan

On Saturday, May 26, 2012 9:27:54 PM UTC+7, Massimo Di Pierro wrote:
>
> Can you please open an issue about the compute on update problem? I will 
> try reproduce and fix it.
>
> On Saturday, 26 May 2012 07:11:28 UTC-5, peter wrote:
>>
>> So
>>
>> def update_images():
>>     rows=db(db.image).select()
>>     for row in rows:
>>         row.update(file=row.file)
>>     db.commit()
>>
>> does work. I wrote (title=row.title) as I was a little loath to write 
>> (file=row.file) as I was not sure if this was okay with 'upload' fields. 
>> Clearly it is.
>>
>> Thinking about it more, a cleaner way of doing it is:
>>
>> def update_images():
>>     rows=db(db.image).select()
>>     for row in rows:
>>         row.update(thumb=THUMB(row['file'])
>>     db.commit()
>>
>> and bypass the compute altogether.
>>
>> HOWEVER I still have the strange situation that the compute gets executed 
>> when one creates a new record, but does not get executed when one edits a 
>> record, even when one changes the image which is stored in 'file'. the 
>> editing is done by clicking the 'edit' link in SQLFORM.grid.
>>
>> 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
>>>
>>

-- 
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.

Reply via email to