On Jul 2, 2008, at 5:27 AM, [EMAIL PROTECTED] wrote:

>
> Hi.
>
> I have clients(table) with address(related one-to-one) and
> persons(related one-to-many)..
>
> I want to do this:
> results =
> ses.query(b.Client).filter(b.Client.address_id==b.Address.id).\
> filter
> (b.Client.id==b.Client_person.client_id).filter(or_(*cols)).all()
>
> Using only:
> results = ses.query(b.Client).filter(or_(*cols)).all()
>
> where *cols is for example:
> b.Address.name.like('%address%')
> or
> b.Client_person.surname.like('%surname%')
> ...
>
> When I do not specify the "join filter", I get all companies...
> With "join filter", everything works fine.
>
> Is there a way to not specify the "join filters" explicitly??


query.join(['relation1, 'relation2']) is a quicker way to make the  
joins.

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