Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Patient(Base):
- __tablename__ = 'patients'
- id = Column(Integer, primary_key=True, nullable=False)
- mother_id = Column(Integer, ForeignKey('patients.id'), index=True)
- mother = relationship('Patient', primaryjoin='Patient.id==Patient.mother_id', remote_side='Patient.id', uselist=False)
- phenoscore = Column(Float)
- patients = Patient.query.filter(Patient.mother.phenoscore == 10)
- patients = Patient.query.filter(Patient.mother.has(phenoscore=10))
- patients = Patient.query.join(Patient.mother, aliased=True)
- .filter_by(phenoscore=10)
- Patient.where(mother___phenoscore=10)
- Comment.where(post___public=True, post___user___name__like='Bi%')
- db_session.query(Patient).join(Patient.mother)
- .filter(Patient.mother.property.mapper.class_.phenoscore==10)
- Patient.query.join(Patient.mother)
- .filter(Patient.mother.property.mapper.class_.phenoscore==10)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement