From 095211b1ff70fdc5af9b22e9a8452a3d776ba36a Mon Sep 17 00:00:00 2001 From: Untone Date: Thu, 14 Oct 2021 08:28:52 +0300 Subject: [PATCH] Topic.cat_id and orm update --- orm/topic.py | 5 ++++- schema.graphql | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/orm/topic.py b/orm/topic.py index 6b9e3c97..a437e305 100644 --- a/orm/topic.py +++ b/orm/topic.py @@ -18,7 +18,10 @@ class Topic(Base): slug: str = Column(String, unique = True, nullable = False) createdAt: str = Column(DateTime, nullable=False, default = datetime.now, comment="Created at") createdBy: str = Column(ForeignKey("user.id"), nullable=False, comment="Author") - value: str = Column(String, nullable=False, comment="Value") + title: str = Column(String, nullable=False, comment="Title") + body: str = Column(String, nullable=True, comment="Body") + pic: str = Column(String, nullable=True, comment="Picture") + cat_id: str = Column(String, nullable=True, comment="Old Category ID") # list of Topics where the current node is the "other party" or "child" 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" diff --git a/schema.graphql b/schema.graphql index 28ef01aa..47755d4f 100644 --- a/schema.graphql +++ b/schema.graphql @@ -256,6 +256,7 @@ type Topic { createdAt: DateTime! parents: [String] # NOTE: topic can have parent topics children: [String] # and children + cat_id: String } # TODO: resolvers to add/remove topics from publication