Sqlalchemy : association table for many-to-many relationship between template_id and department. How can I delete a relationship?
问题 Department = models.department.Department association_table = Table('template_department', models.base.Base.instance().get_base().metadata, Column('template_id', Integer, ForeignKey('templates.id')), Column('department_id', Integer, ForeignKey('departments.id'))) class Template(models.base.Base.instance().get_base()): __tablename__ = 'templates' id = Column(Integer, primary_key=True) tid = Column(String(7), unique=True) .... departments = relationship('Department', secondary=association_table