yup that seems to be the case, was fixed in 0.4.2.

On Feb 11, 2008, at 8:01 PM, David Gardner wrote:

>
> Well sort of... This worked on my local development box (0.4.2p3), but
> my server is still on 0.4.0 and the data is sorted by grandchild only.
> I am assuming this is expected and I just need to upgrade my server to
> get this working?
>
> David Gardner wrote:
>> 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to