You could monkey-patch the dal 'rows' object __str__ by making it export as 
a TSV.

On Wednesday, March 11, 2009 8:01:42 AM UTC-7, Marco Prosperi wrote:
>
> hello everybody, 
> how can I change the following function (defined in appadmin.py 
> controller) so that the downloaded file has tab separated values 
> instead of comma separated? Or do I have to change some settings 
> somewhere? 
>
> thanks in advance, 
> Marco 
>
> def csv(): 
>     import gluon.contenttype 
>     response.headers['Content-Type'] = \ 
>         gluon.contenttype.contenttype('.csv') 
>     db = get_database(request) 
>     query = get_query(request) 
>     if not query: 
>         return None 
>     response.headers['Content-disposition'] = \ 
>         'attachment; filename=%s_%s.csv'\ 
>          % tuple(request.vars.query.split('.')[:2]) 
>     return str(db(query).select())

-- 



Reply via email to