name = Column(String, nullable=False, unique=True)
created_at = Colmn(DateTime, nullable=False, default=func.now())


class Post(Base):
    id = Column(Integer, primary_key=True)
user_id = Column(Integer, ForeignKey(User.id), nullable=False)
user = relationship(User, backref=backref('posts'))
title = Column(String, nullable=False)
body = Column(Text, nullable=False)
created_at = Colmn(DateTime, nullable=False, default=func.now())
User.post_query = relationship(Post, lazy='dynamic')
How to use joinedload/contains_eager for query-enabled relationships (lazy='dynamic' option) in SQLAlchemy