Actually I added the following line on top of the custom_exporter.py file
import cStringIO

On Friday, July 15, 2016 at 10:45:01 PM UTC-5, Jordan Myers wrote:
>
> Hey everyone,
>
> so the default csv exporters for sqlform.grid will use the headers as the 
> 'database' names, but I would rather it use the field.label instead. For 
> example, take this table:
>
> db.define_table('my_table', Field('ugly_name', label='Pretty Name'))
>
> A sqlform.grid on my_table will display the column with the header Pretty 
> Name, but when exporting to csv, the header becomes my_table.ugly_name.  Is 
> there an easy way to export to csv with the columns "as seen" i.e. with the 
> labeled names? I tried writing my own exporter, but it does not preserve 
> the searching/sorting order. I suppose I could try to implement that 
> myself, but that is a last resort.
>
> 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