You do 1000 selects in that code. I would use a join. What is the purpose 
of that code? I am sure there is a better way.

On Wednesday, 17 October 2012 04:09:17 UTC-5, andrej burja wrote:
>
> hi
>
> i have table games and they have tags
> i followed the example in the book and put tags in separate table
>
> now i want to show all games with all tags in the view: game.title, 
> games.instruction, game.tags
> in fuction i have
> for game in games:        
>         equipment =[tag.name for tag in db(db.tag.game_id==game.id
> ).select()]
>         game.f_equipment =', '.join(equipment)
>
> having more than 1000 games (games is row object with more than 1000 
> entries), this is very slow. how can i make that faster?
>
> andrej
>
>

-- 



Reply via email to