You have to update *all* the fields required by the compute function. The
reason is that when doing an update, the update happens entirely in the
database (i.e., web2py does not have a copy of the record in Python), so
the compute function doesn't have access to the existing values of the
other fields.
Anthony
On Monday, October 5, 2015 at 11:12:04 AM UTC-4, Mark Billion wrote:
>
> db.define_table('client',
> Field('d_fn', 'string', length=45, label="""Debtor's
> First Name"""),
> Field('d_ln', 'string', length=45, notnull=True,
> label="""Debtor's Last Name"""),
> . . . .
> Field('caption', compute=lambda r: caption(r.d_fn, r.d_ln,
> r.c_fn, r.c_ln, r.status_flag_string)),
> )
>
> def echo():
> . . . .
> ret = db(query).validate_and_update(**{field_array[2]:v})
>
> When I updated the d_fn and d_ln strings, the caption doesnt update. Any
> way to force this?
>
>
--
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 [email protected].
For more options, visit https://groups.google.com/d/optout.