OK you got it in r4673, sorry youre hitting all these (kinda weird....)

On May 6, 2008, at 7:20 PM, Michael Bayer wrote:

>
> thats really weird.  I dont have time to check this now but i added
> ticket 1027 to confirm.
>
>
> On May 6, 2008, at 5:22 PM, Moshe C. wrote:
>
>> I couldn't create a simple test case, but I have analyzed the cause  
>> of
>> the problem.
>>
>> The order_by() method is sent a list as an argument, but the argument
>> 'criterion' becomes a tuple
>> because of the "def order_by(self, *criterion)" syntax.
>>
>> in the case of "if self._aliases_tail:" , 'criterion' becomes a list
>> again, but if _aliases_tail is None it remains a tuple.
>>
>> Now the cause of the problem is that on the first call to order_by(),
>> self._aliases_tail exists, and on the 2nd call, following the
>> reset_joinpoint() call, it is None. Therefore the '_order_by member'
>> is initialized as a list, and later a tuple is attempted to be
>> concatenated and hence the failure.
>>
>> The calling code from my source looks like this:
>>
>> myquery = Node.query()
>> myquery = myquery.join('parent', aliased=True)
>>
>> myquery = myquery.order_by(Node.c.name)                          #
>> _aliases_tail exists for this call
>> myquery = myquery.reset_joinpoint().order_by(Node.c.popularity)  #
>> _aliases_tail is None for this call
>
>
> >


--~--~---------~--~----~------------~-------~--~----~
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