title: Sqlalchemy - how to get an object, and filter which rows in the child class
body: <p>I’m new to Sqlalchemy, and in need of some help.</p>
  
  <p>i have a model, with a one to many relation:</p>
  
  <pre><code>class Metnadev(DeclarativeBase):
      __tablename__ = 'metnadev'
  
      #personal info
      id = Column(Integer, autoincrement=True, primary_key=True)
      first_name = Column(Unicode(255))
      last_name = Column(Unicode(255))
      birth_day = Column(Date)
      activitys = relationship("Activity", backref="metnadev")
  
  class Activity(DeclarativeBase):
      __tablename__ = 'activity'
  
      id = Column(Integer, autoincrement=True, primary_key=True)
      metnadev_id = Column(Integer, ForeignKey('metnadev.id'))
  
      location = Column(Unicode(255))
      visible = Column(Boolean,default=True)
  </code></pre>
  
  <p>When I do</p>
  
  <pre><code>metnadev = DBSession.query(Metnadev).filter_by(id=kw['id']).one()
  </code></pre>
  
  <p>I get the object, with the child, great.
  I want to get the object, but only get the rows from the child class, where <strong>visible == True</strong></p>
  
  <p>I searched but I’m not sure how to do it,
  Thanks for the help</p>