add community for topics

This commit is contained in:
knst-kotov
2021-12-11 13:23:17 +03:00
parent d0fdfd2b31
commit 2a9d0d613f
3 changed files with 5 additions and 3 deletions

View File

@@ -31,5 +31,5 @@ class Topic(Base):
parents = relationship(lambda: Topic, secondary=Connection, primaryjoin=slug==Connection.c.parent, secondaryjoin=slug==Connection.c.child, viewonly=True)
# list of Topics where the current node is the "parent"
children = relationship(lambda: Topic, secondary=Connection, primaryjoin=slug==Connection.c.child, secondaryjoin=slug==Connection.c.parent)
community = Column(ForeignKey("community.slug"), nullable=True, comment="Community")
community = Column(ForeignKey("community.slug"), nullable=False, comment="Community")