thank you for your answer and sorry for the delay, i had been some days away.
at this time the code that fails is:
tabella = request.args[0]
response.headers['Content-Type']='text/x-csv'
response.headers['Content-Disposition']='attachment;filename="report.csv" '
dati = legacy_db().select(legacy_db[tabella].ALL)
s = cStringIO.StringIO()
dati.export_to_csv_file(s)
so i should use iterselect when defining dati, but when i try something like:
"""
for row in legacy_db(
legacy_db.COD2.id > 0).iterselect():
....: rtn = row
....:
""
i get :
""
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
/home/www-data/web2py/applications/PROVE/models/menu.py in <module>()
----> 1 for row in legacy_db(
legacy_db.COD2.id > 0).iterselect():
2 rtn = row
3
AttributeError: 'Set' object has no attribute 'iterselect'
""
moreover, i should 'append' the row to a pydal.objects.Rows
as to say
dati += row
but how can i do this?
Thank you a lot again
>> 2016-08-04 1:08 GMT+02:00, Dave S <
snide...@gmail.com <javascript:>>:
>> >
>> >
>> > On Wednesday, August 3, 2016 at 2:33:35 PM UTC-7, goome wrote:
>> >>
>> >> when trying in the shell, the shell itself got killed :
>> >> >> In [4]: legacy_db(query).select()
>> >> >>
>> >> >> Killed
>> >> >> root@rb:/home/www-data/web2py#
>> >>
>> >>
>> > Is that using web2py in a bash/python shell (i.,e., -M -S myapp) ?
>> yes, this one
>>
>