On Thursday, March 5, 2015 at 4:18:06 PM UTC-5, Richard wrote:
>
> Yes I struggle with it to make compute works...
>
> I come up with something like this :
>
> after .accepted
>
> for f in db[request.args(0)].fields:
>             if f != db[request.args(0)]._id and f != 
> db[request.args(0)].record_review_status:
>                 form.vars[f] = form.vars.get(f, 
> db[request.args(0)](request.args(1))[f])
>

If it is an update form, all the fields should be in the form already 
(unless they were explicitly excluded from the form). Also, the above does 
a separate database select for every missing field -- it would be better to 
fetch the record just once and then read the fetched record.

Anthony

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

Reply via email to