From abfbb68ac397e4ed1c9fb61a2ab7d5d434ff9386 Mon Sep 17 00:00:00 2001 From: tonyrewin Date: Sat, 19 Nov 2022 16:18:17 +0300 Subject: [PATCH] fix-topic --- schema.graphql | 4 ++-- services/zine/topics.py | 18 +++++++++--------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/schema.graphql b/schema.graphql index cae08932..1f89ecdc 100644 --- a/schema.graphql +++ b/schema.graphql @@ -117,8 +117,8 @@ input TopicInput { title: String body: String pic: String - children: [String] - parents: [String] + # children: [String] + # parents: [String] } input ReactionInput { diff --git a/services/zine/topics.py b/services/zine/topics.py index ee95dfd2..13889899 100644 --- a/services/zine/topics.py +++ b/services/zine/topics.py @@ -17,15 +17,15 @@ class TopicStorage: print("[zine.topics] %d precached" % len(self.topics.keys())) - @staticmethod - def load_parents(topic): - self = TopicStorage - parents = [] - for parent in self.topics.values(): - if topic.slug in parent.children: - parents.append(parent.slug) - topic.parents = parents - return topic + # @staticmethod + # def load_parents(topic): + # self = TopicStorage + # parents = [] + # for parent in self.topics.values(): + # if topic.slug in parent.children: + # parents.append(parent.slug) + # topic.parents = parents + # return topic @staticmethod async def get_topics_all():