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 9:52 GMT+02:00, c...@cemeren.com <c...@cemeren.com>:
> You may try using iterselect() instead of select() if the issue is memory
> related.
>
> The link to the book is below.
>
> http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer?search=Using-an-iterator-based-select-for-lower-memory-use#Using-an-iterator-based-select-for-lower-memory-use
>
> On Thursday, August 4, 2016 at 10:35:13 AM UTC+3, goome wrote:
>>
>> 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
>>
>
> --
> 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 a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/web2py/nqUnVx62GE0/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

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