I'm relatively new to python and webpy (and ORM) in general and had a "best
practice" question. I want to do selects and joins from some mysql tables
and looking at the examples from the webpy tutorial I notice that the db and
table connects are made in the main class and then iteration through the
rows is done in the template in a for loop. I was under the impression that
most of the heavy lifting should be done pre template if possible. Perhaps
doing all the querying in the main class and then just passing those results
to the template? What'd be the best approach to display a bunch of blog post
titles with a join against a separate comments table (indexed by post ID) to
gather the number of comments per post? This is very simple obviously but
I'm just trying to get a sense of where the logic should be taking place.

Thanks all.

-- 
You received this message because you are subscribed to the Google Groups 
"web.py" group.
To post to this group, send email to webpy@googlegroups.com.
To unsubscribe from this group, send email to 
webpy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/webpy?hl=en.

Reply via email to