On Wed, Oct 12, 2011 at 2:00 PM, Mariano Mara <mariano.m...@gmail.com>wrote:
>
> The "with recursive" sql idiom (such as the one you would find in pgsql and
> oracle) could be of help on this situation.


It's harder than it sounds to actually utilize that. Each step of traversal
expects a new context object, and there isn't an obvious spot in the
traversal process to say "ok we're done, now perform the query". Also AFAIK
SQLAlchemy doesn't provide much assistance in building a "with recursive"
query.

Assuming you had some way to return dummy "query builder" objects during
traversal, you might be able to use a ContextFound event at the end of
traversal to actually perform the database query and replace the context
before view lookup is performed. To know what the dummy objects represent
you'd probably still need some in-memory representation of your tree
structure.

Possibly something smarter could be done with a custom traverser as well.

-- 

Michael

-- 
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 
pylons-discuss+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en.

Reply via email to