On 4/7/08, Jonathan Ellis <[EMAIL PROTECTED]> wrote:
> I'm confused -- this sample does correlate actions with tasks, but not
>  tasks with connections.  Intuitively it seems that X.has(Y) should
>  always add a clause to the the exists for y.y_id = x.y_id.  No?

Mike cleared this up for me in IRC:

X.prop.has(<criterion>) just means,

exists(select 1 from child where child.id=parent.x_id AND <criterion>)

so the more elegant way to do this is

session.query(Action).filter(Action.task.has(Task.connection.has(Connection.caller==caller1)))

-Jonathan

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