From affbd97593cd571b4cc9de3605ad6f23c5bd75a8 Mon Sep 17 00:00:00 2001 From: Goffi Date: Mon, 17 Apr 2017 20:34:43 +0200 Subject: [PATCH] tools (common/data_objects): comments items can now be chained to their parent --- src/tools/common/data_objects.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/tools/common/data_objects.py b/src/tools/common/data_objects.py index b249f2f1..43c6534d 100644 --- a/src/tools/common/data_objects.py +++ b/src/tools/common/data_objects.py @@ -33,6 +33,7 @@ class BlogItem(object): self._tags = None self._groups = None self._comments = None + self._comments_items_list = None @property def id(self): @@ -114,6 +115,16 @@ class BlogItem(object): def comments_node(self): return self.mb_data.get(u'comments_node') + @property + def comments_items_list(self): + return [] if self._comments_items_list is None else self._comments_items_list + + def appendCommentsItems(self, items): + """append comments items to self.comments_items""" + if self._comments_items_list is None: + self._comments_items_list = [] + self._comments_items_list.append(items) + class BlogItems(object):