title: SQLAlchemy query filter on child attribute
body: <p>My model consists of a Parent and Child with a one-to-one relationship:</p>
  
  <pre><code>class Parent(Base):
      __tablename__ = 'parent'
      id = Column(Integer, primary_key=True)
      name = Column(String)
      child = relationship("Child", backref="parent", uselist=False, lazy='joined')
  
  
  class Child(Base):
      __tablename__ = 'child'
      child_id = Column(Integer, ForeignKey(Parent.id), primary_key=True)
      value = Column(Integer)
  </code></pre>
  
  <p>my test data are the following:</p>
  
  <pre><code>q = s.query(Parent)
  pd.read_sql(q.statement,s.bind) 
      id  name  child_id  value
      1      a         1     10
      2      b         2     20
      3      c         3     30
  </code></pre>
  
  <p>Now I'd like to get only the parents with child.value > 20 using this query:</p>
  
  <pre><code>q = s.query(Parent).filter(Parent.child.value &gt; 20)
  </code></pre>
  
  <p>but this error occurs:</p>
  
  <pre><code>AttributeError: Neither 'InstrumentedAttribute' object nor 'Comparator' object 
  associated with Parent.child has an attribute 'value'
  </code></pre>
  
  <p>Of course I can query direct on the Child class but my goal is to retrieve a Parent object.</p>