I trying to get an export over my tablestructure in a readable Form (csv) 
and can't get a single object as a return value.

my (simplified) table structur:

table: workshops  
title  

table: event_date  
workshop reference workshops  
date

table: extra_cost  
workshop reference workshops  
costs

table: participant  
workshop reference workshops  
payment  
name  

The event_date table is necessary due to workshops having more than one 
date. 

right now I'm getting all the data via multiple selects: 

workshops = db((workshops.id==event_date.workshop).select(workshop.id, 
workshop.title, groupby:workshop.id, distinct=True)  for ws in workshops  
   ws['part_count'] = db.(ws.id==partcipant.workshop).count()
   same for sums over payment and extracost and dates

with this I can display the date I want in a view via {{for ...}} but can't 
really use the csv export.
I tried to fuse the results into one object as you can see, but print 
workshops only results in the original table. But when I print ws the added 
data is there.

The only way to get the desired results is by using _extra=ws in the for 
loop and adding another entry at workshop.columns. but since this isn't the 
"official" way, I'm wondering if I can do this better.

Thanks in advance :)

-- 

--- 
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 [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to