On Sunday 12 October 2008 19:05:44 Alessandro Dentella wrote: > On Sat, Oct 11, 2008 at 11:19:31PM -0400, Michael Bayer wrote: > > On Oct 11, 2008, at 1:44 PM, sandro dentella wrote: > > > Hi, > > > > > > I started using the .join() method on query and that' s really > > > powerful, with reset_joinpoint and the list of attributes > > > setting the path of relations. Now I'd like to being able to > > > write join clause in advance with respect to the moment I have > > > the the query available , in he same way I can write ClauseList > > > in advance. Is there any way? > > > > this sounds like you mean...... j = [SomeClass.someprop, > > SomeOtherClass.someotheroprop] > > .....sess.query(SomeClass).join(*j) ? > > No. But what i wanted is really probably un-viable and anyhow I > found a different way to do it. I'll explain anyhow. > > .filter() acts on a query that may have been composed with some > .join() so that I'd like to see it as a single operation on query > after wich I issue a .reset_joinpoint(). > > Since I have a GUI that allows to add many different filters > in this way, I wanted to consider each 'join + filter + reset' as a > unit to be applied to the original query. > > I mistakenly thought that ClauseList was sort of such a unit while > this is just an argument to .filter() > > Now I just exposed the qyery object to each filter widget that > applies directly the join+filter+reset. > in theory, u can make a sort of recorder/player pattern and apply (play) that later to the query. but it can be tedious...
--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sqlalchemy" 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/sqlalchemy?hl=en -~----------~----~----~----~------~----~------~--~---
