I have a model X and a model Y.
Y contains a foreign key reference to X.id, with a instance of the related X entry available by the property x.
x_id = Column(Integer, ForeignKey('xtable.id'))
x = relationship('X')
X also has a boolean property 'publish'.
Executing a query on Y, how can i filter my results to those where x.publish is True;
Ive tried doing something like this:
DBSession.query(Y).filter_by(x.publish = True).all()
But this doesnt work, i get an error saying keyword cant be an expression. Ive looked through the sql alchemy docs for a solution, but i cant seem to find what im looking for. Any suggestions?