[EMAIL PROTECTED] schrieb:
> I noticed if I use the select method of a model object it appears to
> return an SQL query..... it is only when I convert the result to a
> list that I get model objects?
> 
> e.g. my_objects = list( my_app.model.MyClass.select() )
> 
> This is pretty slick/clever.  Anyone got any details of what is going
> on?
> 
> It appears the list type conversion does a lot of work I'm surprised
> it does.

You can only be surprised, if you didn't read the SQLObject
documentation carefully ;-)

>From http://sqlobject.org/SQLObject.html#selecting-multiple-objects :

"Select results are generators, which are lazily evaluated. So the SQL
is only executed when you iterate over the select results, or if you use
list() to force the result to be executed."

Chris

--~--~---------~--~----~------------~-------~--~----~
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?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to