I figured a work around:

```
if request.controller == 'default':
        ctID = ctID.t_trial.f_ctid
    else:
        ctID = ctID.f_ctid
```

It would be nice to fix from the source.

On Thursday, February 1, 2018 at 6:39:37 PM UTC-8, Yi Liu wrote:
>
> Dear all,
>
> I have a field with custom represent:
> ```
> Field('f_lastupdate', type='string',
>           label=T('Last Update'), represent=lambda value, row: 
> lastUpdateDateFormat(value, row['t_trial']['f_ctid'])),
> ```
>
> It is fine in the application (default.py), but not in appadmin when i 
> admin the table.
>
> If i change row['t_trial']['f_ctid'] to row['f_ctid'], appadmin works but 
> the application throws similar error. It seems appadmin.py interpret the 
> lambda function differently than default.py, causing keyerror or 
> attributeerror
>
> Am I missing something? Thanks!
>

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