i havent looked yet but this is likely a bug in eager loading when it  
interacts with polymorphic.  are you on trunk ?


On Dec 14, 2007, at 1:37 PM, Alexandre Conrad wrote:

> Hi,
>
> I was wondering why "lazy=False" on a polymorphic joined table  
> relation
> worked fine, until I pass an extra join() to filter with like("%foo%")
> statments from my "search()" method.
>
> I found an alternative where I just enable the relation's lazyness by
> providing lazyload():
>
> #OK
> session.query(Client).all()
>
> #(OperationalError) ambiguous column name: companies.id_address
> session.query(Client).join("address").filter(or_(*OR)).all()
>
> #OK
> session 
> .query 
> (Client 
> ).options(lazyload("address")).join("address").filter(or_(*OR)).all()
>
> Is this how I should do it ? Or could this be detected, thus avoided ?
>
> Test case attached. Thank you.
>
> Regards,
> -- 
> Alexandre CONRAD
>
> >
> <SA_lazy_polymorphic.py>


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