Wichert Akkerman wrote:
>
>
> I was expecting the join to automatically created since the
> Account.calendar relation depends on it. Adding a .join(model.Event) to
> the query before the filter() calls indeed fixes this. Does SQLAlchemy
> indeed assume that my usage of models.Event as query filters has no
> relation at all to the calendar relation?

Filtering never implies how the tables are joined. SQLA never creates a
join "implicitly", there is always something you did which told it to do
so (in the case of the eager load, lazy=False).  When querying, there's
any number of ways you might want to join two tables together even though
there may be one way that is typical (and it is extremely easy to join in
the "typical" way, but you still have to tell it to do such).

As far as the eagerload being involved there's some related discussion on
this at
http://www.sqlalchemy.org/trac/wiki/FAQ#ImusinglazyFalsetocreateaJOINOUTERJOINandSQLAlchemyisnotconstructingthequerywhenItrytoaddaWHEREORDERBYLIMITetc.whichreliesupontheOUTERJOIN


--

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