code: def last_post(self):
          
          posts = [n.last_post for n in self.children if n.last_post is not None]
          children_last_post = max(posts, key=lambda p: p.created) if posts else None
          if children_last_post and self.obj.last_post_id:
              return max(self.obj.last_post, children_last_post, key=lambda p: p.created)
          return children_last_post or self.obj.last_post
docs: Returns the latest post associated with the node or one of its descendants.