[web2py] Re: Web2py: Create a CSV file to download for an executesql result

2015-03-29 Thread Anthony
If you know the column names and types ahead of time, you can do something like this: db.define_table('mydummytable', Field('field1'), ..., migrate=False) rows = db.executesql(sql_statement, fields=db.mydummytable) The purpose of the dummy table i

[web2py] Re: Web2py: Create a CSV file to download for an executesql result

2015-03-28 Thread Brian M
Here's an old post with the solution that I use for this https://groups.google.com/d/msg/web2py/4QhEULmJ8YE/aNBcJv81RocJ Yep, I've got a processing app that spits out all sorts of csv files based on data gathered from multiple sources. Here's a little helper function I use def csv_export(recor