On Tuesday, May 22, 2018 at 10:43:33 AM UTC-4, Ayron Rangel wrote:
>
> Guys,
>
> How can i custom print the list:reference <table> ??? I try to print the
> list reference and appears like this: [9L, 10L] not Item 9 - Pencil ;
> Item 10 - erase
>
> In my case i have this:
> model:
> Field('item', 'list:reference itens')
>
> view:
> {{for row in results:}}
> {{=row.item}}
>
Try:
{{for row in results.render():}}
Also, make sure you specify the "format" argument when defining the
db.items table. As long as you do that, the "list:reference items" field
will get a default "represent" attribute that will use the "format"
argument to generate a list of items. The "represent" attribute will be
used by the .render() method to transform the list of integer IDs stored in
the field.
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.