Em Quinta 22 Junho 2006 20:29, Ksenia Marasanova escreveu: > I am hitting a performance wall with SQLObject. > I use MyClass.select() to display 100 records on a page. The problem > is that besides 1 query to fetch the records, 1 query per record is > executed to get the properties of every object. That makes 101 queries > to display a simple page :(. > Are there any tricks to pre-populate the objects, based on a data from > the main query? If no, I was thinking of using plain SQL, and creating > some dict/list wrapper to pretend every row to be MyClass-compatible. > There are several templates that use the same selectresults and > changing them all to use list / dict would be a chore...
You can use SQLObject sqlbuilder's select instead of the select method for each class. There you'd write your query so that all 100 records and their properties are returned. -- Jorge Godoy <[EMAIL PROTECTED]> --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "TurboGears" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/turbogears -~----------~----~----~----~------~----~------~--~---

