以下问题赞为解决:

# 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'))

相关文章:

  • 2021-11-04
  • 2021-08-13
  • 2021-04-10
猜你喜欢
  • 2021-09-27
  • 2022-01-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-19
相关资源
相似解决方案