class Post(Base):
    id = Column(Integer, primary_key=True)
user_id = Column(Integer, ForeignKey(User.id), nullable=False)
How to use joinedload/contains_eager for query-enabled relationships (lazy='dynamic' option) in SQLAlchemy