Fix Python – SqlAlchemy – Filtering by Relationship Attribute

I don’t have much experience with SQLAlchemy and I have a problem, which I can’t solve. I tried searching and I tried a lot of code.
This is my Class (reduced to the most significant code):
class Patient(Base):
__tablename__ = ‘patients’
id = Column(Integer, primary_key=True, nullable=False)
mother_id = Column(Integer, ForeignKey(‘pati….