def get_thread(self, id): thr = Thread(id=id) self.fill_thread(thr) thr.date = thr.root.date thr.title = thr.root.title thr.url = thr.root.url return thr
def _build_thread(self, data): thread = Thread("%s.%s" % (data["commentable_id"], data["id"])) thread.title = data["title"] thread.date = dateutil.parser.parse(data["created_at"]) thread.url = self.browser.thread.build(course=self.browser.course, topic=data["commentable_id"], id=data["id"]) thread.root = self._build_message(data, thread) thread._messages_count = data["comments_count"] + 1 return thread