Hi Massimo,

I tried this:

auth.settings.extra_fields['auth_user']= [
        ...
        Field('dept_grid', compute = lambda row:
Departamento[row['departamento_id']].nome if row['departamento_id'] else
None, label = 'Departamento'),
        Field.Virtual('dept_name', lambda row:
Departamento[row.departamento_id].nome if row.departamento_id else None,
label = 'Departamento')]

The compute field work, the virtual field does not work. And the error by
calling the table in SQLFORM.grid:

AttributeError: 'Row' object has no attribute 'dept_name'


Can I use virtual field to display information from another table?

Thanks,

Fabiano.


2014-07-10 3:55 GMT-03:00 Massimo Di Pierro <massimo.dipie...@gmail.com>:

> auth.settings.extra_fields['auth_user'] = [Field.Virtual(....), ... ]
>
>
> On Wednesday, 9 July 2014 13:14:14 UTC-5, Fabiano Almeida wrote:
>>
>> Hi again,
>>
>> It's possible insert virtual field in auth_user? how?
>>
>> thanks,
>>
>> Fabiano.
>>
>  --
> 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 web2py+unsubscr...@googlegroups.com.
> 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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to