以下问题赞为解决:
# class User(Base):
# __tablename__ = 'user'
# #表的结构
# id = Column(String(20), primary_key=True)
# username = Column(String(20))
# books = relationship('Book')
# class Book(Base):
# __tablename__ = 'book'
#
# id = Column(String(20), primary_key=True)
# name = Column(String(20))
# # “多”的一方的book表是通过外键关联到user表的:
# user_id = Column(String(20), ForeignKey('user.id'))