You can do a loop in the view -- just prepare a data structure in the controller and pass it to the view (i.e., move the queries to the controller). Actually, you can probably just do a single query including all items in taxonomy_set (and orderby that field) -- then just send the entire Rows object to the view and loop through it. Note, you should also probably avoid using the .render() method to translate each foreign key to its represented value, as that will issue a separate database query for each item. Instead, maybe change your query to do a join and include the relevant fields from the foreign table.
Anthonyh On Saturday, October 15, 2016 at 5:34:02 PM UTC-4, Alex Glaros wrote: > > thanks Massimo and Anthony > > it's working now but don't know how to get around writing a loop in the > view. Can you please explain in general principles how to get loop written > in controller to display in view? > -- 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 [email protected]. For more options, visit https://groups.google.com/d/optout.

