user_id = Column(Integer, ForeignKey(User.id), nullable=False)
user = relationship(User, backref=backref('posts'))
How to use joinedload/contains_eager for query-enabled relationships (lazy='dynamic' option) in SQLAlchemy