On Sep 4, 2008, at 4:32 PM, Michael Bayer wrote:

>
>
> On Sep 4, 2008, at 4:17 PM, Jon wrote:
>
>>
>> I'm using 0.4.6 but I thought I'd give 0.5b3 a try.
>>
>> An existing (working) query failed with:
>>
>> Query.__no_criterion() being called on a Query with existing
>> criterion.
>>
>> I tracked that down to using order_by when building the query.
>> An example is below:
>>
>> q = dbsess.query(Obj)
>> q = q.order_by(Obj.name)
>> instance = q.get(some_id)
>>
>> Why does this happen and is it a bug?
>
> it doesn't make sense to call order_by() before calling get().   SQLA
> raises an error instead of silently ignoring criterion which can't be
> applied.
>

I made a correction in r5084 such that the message is now:

sqlalchemy.exc.InvalidRequestError: Query.get() being called on a  
Query with existing criterion.



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

Reply via email to