On Tuesday, May 22, 2018 at 12:26:00 PM UTC-4, Ayron Rangel wrote:
>
> Anthony,
>>
>
> It's possible to convert to str()???? How can i do this??
>
> {for x in item.render():}}
>
The .render() method is for Rows objects, not for an individual field
value. The default "represent" function for a list:reference field will
produce a string of comma-separated items, like "Item A, Item B, Item C".
If you want that back in a Python list, you could do:
{{for element in item.split(', '):}}
Alternatively, you could create a custom "represent" function that
generates the list that you want (or it could even generate a set of TD's
containing the items).
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 [email protected].
For more options, visit https://groups.google.com/d/optout.