Thank you this worked for me. > You can put the child order by at the end using reset_joinpoint(): > > grandchildren = session.query(Node).filter(Node.c.type==var1).\ > join('Parent', aliased=True).filter(Node.c.type==var2).\ > order_by(Node.name).\ > join('Parent',aliased=True,from_joinpoint=True).\ > filter(Node.uid==var3).reset_joinpoint().\ > order_by(Node.name).\ > all () > > > if you are using trunk, you can alternatively use an actual Alias to > construct the join and later reference that alias in the order_by(): > > parents = nodes.alias() > grandchildren = session.query(Node).filter(Node.c.type==var1).\ > join([('Parent', parents)]).filter(Node.c.type==var2).\ > join('Parent',aliased=True,from_joinpoint=True).\ > filter(Node.uid==var3). > order_by([parents.c.name, Node.name]).\ > all () > > > > > > > >
--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalchemy@googlegroups.com 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 -~----------~----~----~----~------~----~------~--~---