On Tuesday, March 7, 2017 at 6:10:01 PM UTC-8, Marcelo Huerta wrote:
>
> Running 2.14.6-stable+timestamp.2016.05.10.00.21.47 on Ubuntu and Windows 
> 7, python 2.7
>
> When I try to generate a CSV or TSV from a grid with a Virtual Field, I 
> get a ticket with a KeyError.
>
>
Can you show us your table definition?

Others will have to answer whether the CSV code knows whether a field is 
virtual or actual.  Looking at gluon/tools.py, server_csv() calls  
universal_caller(), which appears to pass along as many positional and 
named arguments as it can, and for the csv case the named args come from 
request.vars.

/dps

 

> Traceback (most recent call last):
>   File "F:\Prog\web2py\gluon\restricted.py", line 227, in restricted
>     exec ccode in environment
>   File "F:\Prog\web2py\applications\axxoneval\controllers/default.py", line 
> 447, in <module>
>   File "F:\Prog\web2py\gluon\globals.py", line 417, in <lambda>
>     self._caller = lambda f: f()
>   File "F:\Prog\web2py\gluon\tools.py", line 4250, in f
>     return action(*a, **b)
>   File "F:\Prog\web2py\applications\axxoneval\controllers/default.py", line 
> 199, in listar_evaluaciones
>     csv = True, create = False, editable = False, deletable = True, 
> searchable=True, details=False,
>   File "F:\Prog\web2py\gluon\sqlhtml.py", line 2752, in grid
>     value = row[str(field)]
>   File "F:\Prog\web2py\gluon\packages\dal\pydal\objects.py", line 76, in 
> __getitem__
>     raise KeyError
> KeyError
>
> Is this a known problem?
>
>

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