​
​​
Hi,
In my model file I have defined table and Label for the fields like this - 
db.define_table('mytable',
                Field('fname', 'string', length=12, writable=False,
                      notnull=True, label='First Name'),
               Field('lname', 'string', length=12, writable=False,
                      notnull=True, label='Last Name'),
...........................

1. In case of Grids, table headers are coming from  model file (shown 
above) No extra code has been written to show the labels from the model 
file.

2. So I was expecting the same headers would come to CSV file also, but 
surprisingly when I export to CSV we dont get these labels. (I tried by 
doing CSV=true in case of grid and still gets mytable.fname)

3. From documentation, I found Grid has additional parameter. i.e headers I 
tired to use that parameter to see if it works in export. So I defined 
headers as below :
headers = {'db.mytable.fname': 'First Name',
                   'db.mytable.lname': 'Last Name'
                  }

However export to CSV is still showing headers as db.mytable.fname

Please guide.
I suspect this is BUG in web2py export to csv which is not taking label 
from model file.
Thanks in Advance!!!

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