title: How to query on eagerly joined tables in SQLAlchemy?
body: <p>I have 3 tables</p>
  <pre><code>class DB1(Base):
     row1 = Column(Integer, primary_key=True)
     row2 = Column(String)
     row3 = relationship(&quot;db2&quot;, lazy='joined')
  
  class DB2(Base):
     row1 = Column(Integer, primary_key=True)
     row2 = Column(String)
     row3 = relationship(&quot;db3&quot;, lazy='joined')
  
  class DB3(Base):
      row1 = Column(Integer, primary_key=True)
      row2 = Column(String)
  </code></pre>
  <p>Considering the eager joins, my query looks like this</p>
  <pre><code>SELECT db1.row1 AS db1_row1, db1.row2 AS db_row2, db1.row3 as db_row3
  db2.row1 AS db2_row1, db2.row2 AS db_row2, db2.row3 AS db_row3,
  db3.row1 AS db3_row1, db3.row2 AS db_row2
  
  FROM db1 
  LEFT OUTER JOIN db2 AS db2_1 ON db2_1.row1 = db1.row3 
  LEFT OUTER JOIN db3 AS db3_1 ON db3_1.row1 = db2.row3
  </code></pre>
  <p>The query is in a Query object and I want to apply filter conditions on db2 and db3 but in the Query, they are named as db2_1 and db3_1. I am applying filter conditions dynamically so I do not have access to the names &quot;db2_1&quot; and &quot;db3_1&quot;. How do I go ahead? Thanks.</p>