changeset 2228:cf6c539672c7

tools (common/data_objects): comments items can now be chained to their parent
author Goffi <goffi@goffi.org>
date Mon, 17 Apr 2017 20:34:43 +0200
parents 79d279d1ee88
children 761fa220a717
files src/tools/common/data_objects.py
diffstat 1 files changed, 11 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/tools/common/data_objects.py	Mon Apr 17 20:33:32 2017 +0200
+++ b/src/tools/common/data_objects.py	Mon Apr 17 20:34:43 2017 +0200
@@ -33,6 +33,7 @@
         self._tags = None
         self._groups = None
         self._comments = None
+        self._comments_items_list = None
 
     @property
     def id(self):
@@ -114,6 +115,16 @@
     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):