Hi all,
I am having issue exporting virtual fields to CSV using grid. It displays
fine though.
I defined field in this way
Field.Virtual('cost_value', lambda row: row.inventory.cost_price_avg *
row.inventory.qty, label=T('Stock value')),
When I export it to CSV in grid I got the following error
<type 'exceptions.KeyError'> '"inventory"."cost_value"'
The grid was a simple one
fields = [db.inventory.qty, db.inventory.cost_price_avg,db.inventory.cost_value]
grid = SQLFORM.grid(db.inventory, maxtextlength=64, paginate=20, create=False,
details=False, editable=editable, deletable=deletable,
fields=fields,
links=links,
)
Any clue?
Thanks!
Vic
--
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.