For the requires part, see Anthony answer here :
https://groups.google.com/d/msg/web2py/QBTYaytNypU/DW2HpnT-xK0J

Representation is easier :
represent lambda id, row: '{0} {1} {2}'.format(row.produc_name,
db.company(id).name, db.region(db.company(id).id).name) if id else T('N/A')

I am not sure Steve code works, thanks to report if it works I am curious...

Richard

On Mon, Jul 6, 2015 at 8:02 PM, 黄祥 <[email protected]> wrote:

> please try (not tested)
>
> db.define_table('company',
>     Field('name'),
>     Field('region', 'reference region'),
>     format = lambda r: '%s - %s' % (r.name, r.region.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/d/optout.
>

-- 
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.

Reply via email to