What I have ended up with is the following:

class Group(Base):
    events = relationship('Event', lazy=True)

session.query(Group).join(Group.events).options(contains_eager(Group.events).filter(Event.e_date=='2013-01-01')

The above gives me what I want and does not look crazy. It might be using 
undocumented side effect of *contains_eager* option though.

- alex

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to