W liście Tomasz Nazar z dnia środa 15 października 2008:

> I started to play with SQLa joins and 'add_entity' feature lately, so
> if I would get all objects in one query that would be not so bad.
> However, to do that one needs to learn SQLa query language a lot, and
> build some advanced queries (and there aren't lots of examples in the
> documentation :( ).
> And also with 'add_entity' I loose my OO, and relations between
> objects. Query result is not just a list of objects, but a touple of
> all the different objects from the query...


Why not just use eager loading (well documented in sqlalchemy docs)? This uses 
joins and loads the related objects automatically while still returning 
object graph, not tuples. Also, when an object was already loaded, then 
future requests for this object will not hit the db at all.

-- 
Paweł Stradomski

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to pylons-discuss@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to