Cascade the models when deleting tags
This commit is contained in:
parent
78b3befcb3
commit
763427017b
1 changed files with 1 additions and 1 deletions
|
@ -51,7 +51,7 @@ class Tag(Base):
|
||||||
name = Column(String, unique=True)
|
name = Column(String, unique=True)
|
||||||
reporting = Column(Boolean, default=True)
|
reporting = Column(Boolean, default=True)
|
||||||
description = Column(String)
|
description = Column(String)
|
||||||
transactions = relationship("Transaction", secondary=association_table, back_populates="tags")
|
transactions = relationship("Transaction", secondary=association_table, back_populates="tags", cascade="all")
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
return f"<Tag {self.name}>"
|
return f"<Tag {self.name}>"
|
||||||
|
|
Loading…
Add table
Reference in a new issue