tools (common/data_objects): comments items can now be chained to their parent

This commit is contained in:
Goffi 2017-04-17 20:34:43 +02:00
commit affbd97593

View file

@ -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):