[storm] Fwd: Lazy loading?
James Henstridge
james at jamesh.id.au
Mon Sep 21 03:02:08 BST 2009
On Fri, Sep 18, 2009 at 5:57 PM, peter websdell
<flyingdeckchair at googlemail.com> wrote:
> Hi James,
> if you look here, it discusses lazy and "eager" loading in about the 8th
> paragraph down.
> http://www.sqlalchemy.org/docs/05/ormtutorial.html#working-with-related-objects
> Here a php ORM - has a with() method, or $load_with class attribute for
> this:
> http://docs.kohanaphp.com/libraries/orm#with
Okay. With the exception of the $load_with feature, both of those
involve specifying the joins at the point where you build the query,
which is a fairly sensible way to do it.
We had a similar feature to this in the version of SQLObject that
Launchpad used to use under the name "prejoins". There is an
implementation of this on top of Storm's existing find() method in the
compatibility layer we built for the migration (the storm.sqlobject
module). It looks like the SQLAlchemy one can handle reference sets
as well as references: something that we don't handle.
If eager loading of references is all you're after, you can do it the
way I described earlier (that is how the compatibility layer does it).
James.
More information about the storm
mailing list