[sqlalchemy] Re: adjacency list: filtering relations eagerly

2007-10-09 Thread stephen emslie
Hi. I've been quiet on this for a while. I'm getting by without this behavior, though it would be nice to get a bit of clarity. Just to refresh, I've got an implementation very similar to the adjacency list example. Michael has helped me to eager load a subset of a node's children with a call to

[sqlalchemy] Re: adjacency list: filtering relations eagerly

2007-10-09 Thread stephen emslie
Thanks for the quick response. Looking forward to the refactoring :) Stephen Emslie On 10/9/07, Michael Bayer [EMAIL PROTECTED] wrote: On Oct 9, 2007, at 10:18 AM, stephen emslie wrote: Hi. I've been quiet on this for a while. I'm getting by without this behavior, though it would be

[sqlalchemy] Re: adjacency list: filtering relations eagerly

2007-09-11 Thread stephen emslie
I've done some more playing here and I think I can see why the multiple contains_eager options dont work on a self-referential mapping. Here's my example again: ali = trees.alias() ali2 = trees.alias() statement = trees.outerjoin(ali, and_(trees.c.node_id==ali.c.parent_node_id,

[sqlalchemy] Re: adjacency list: filtering relations eagerly

2007-09-04 Thread stephen emslie
im going to play with this a little bit, but my first instinct is that you might want to use contains_eager('children.children', ...) for your deeper aliases. but im not sure if something might prevent that from working since i havent tested contains_eager in self- referential scenarios as

[sqlalchemy] Re: adjacency list: filtering relations eagerly

2007-08-31 Thread stephen emslie
On 8/20/07, Michael Bayer [EMAIL PROTECTED] wrote: I'd be curious though if you could play around a little with the approach I just suggested to see if its at all workable ? After quite a bit of head-scratching I think I've got the hang of this. Here's what I'm doing using the basic_tree.py

[sqlalchemy] Re: adjacency list: filtering relations eagerly

2007-08-20 Thread Michael Bayer
On Aug 20, 2007, at 5:35 AM, stephen emslie wrote: Hi. I am using a self-referential mapper to represent a multi-level tree of parent-child relationships. Typically I've been querying each parent for children that I am interested in. Up till now I have made a new query for each child that