You could also do something like what is suggested here: 
https://github.com/web2py/web2py/issues/1553#issuecomment-270406959. Though 
as noted, the aggregate column will not be sortable, and you'd need to add 
some code to remove the link in the UI that allows it to be selected for 
sorting.

Anthony

On Thursday, January 19, 2017 at 8:17:28 AM UTC-5, Anthony wrote:
>
> On Thursday, January 19, 2017 at 8:02:23 AM UTC-5, James Booth wrote:
>>
>> Hm, so there's no real way to do this at the minute? 
>>
>
>> The problem is, if I do it via executesql or virtual fields, I can't 
>> export it as CSV which is my primary goal.
>>
>
> You could (a) create a view in the database to represent the data and then 
> define a DAL model based on that view, (b) dynamically load the data into a 
> SQLite memory database and use that with the grid, (c) don't use the grid 
> (i.e., generate the query you need and use the resulting Rows object to 
> generate your own tabular display and CSV export -- the Rows object has an 
> .export_to_csv_file method to facilitate this).
>
> It's rare that there is "no real way" to do something -- it just might be 
> a little more complicated than you'd like. :-)
>
> Anthony
>

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