Yes, a Python feature called string formatting
http://docs.python.org/2/library/stdtypes.html#string-formatting-operations
r['first_name'] and r['last_name'] are processed by their str function
because of the %s in "%s %s" the format specifier.
The standalone % is the operator specifying string formatting.
The result of the expression is a string containing the two strings with a
space separator.
On Saturday, 16 November 2013 22:41:16 UTC-8, Alex Glaros wrote:
>
> Thanks guys, it worked.
>
> Field('personDisplayName', compute=lambda r: "%s %s" % (r['first_name'], r
> ['last_name']))
>
> How would you identify the workings of each component, I mean does "%s %s"
> mean "put two strings together here that are identified after the percent
> sign?"
>
> Much appreciated!
>
> Alex
>
--
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.