Can use colnames parameter of export_to_csv_file ?

I tried to use it But got following error.

<type 'exceptions.AttributeError'> 'Row' object has no attribute '_extra'

What is the format for colnames?


On Wednesday, May 13, 2015 at 1:23:33 AM UTC+5:30, Niphlod wrote:
>
> the export are for raw processing, so they get the same result as you 
> would get - for practical purposes - from db(query).select().as_csv()
>
> On Tuesday, May 12, 2015 at 7:07:40 PM UTC+2, Sujata Aghor wrote:
>>
>>
>> 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
>>
>> Kindly 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