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

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

Attachment: SA_lazy_polymorphic.py
Description: application/python

Reply via email to