it's still an invalid python syntax.
correction to the above....

Field('personDisplayName', compute=lambda r: "%s %s" % (r['first_name'], 
r['last_name']))

should work.

>>> record = dict(first_name='john', last_name='foo')
>>> result = lambda r : "%s %s" % (r['first_name'], r['last_name'])
>>> result(record)
'john foo'
>>> 




On Saturday, November 16, 2013 12:37:24 PM UTC+1, 黄祥 wrote:
>
> no it's not work, the point i want to show in here is at the first time 
> the code was :
> Field('personDisplayName', compute=lambda r: r[first_name] [last_name])
> lack of r on [last_name]
>
> best regards,
> stifan
>

-- 
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/groups/opt_out.

Reply via email to