def __eq__(self, other): """ Determine if this node is equal to ``other``. """ if other.__class__ == Node: nd_self = self.node_data nd_other = core.get_node(self._cursor, other.id) return nd_self.to_dict() == nd_other.to_dict() return False
def get_node(self, node_id): """ Get node with given database ID. :param int node_id: Database ID """ node_id = core.get_node(self.cursor, node_id).id return self.node_factory(self, node_id)
def _node_data(self): """ Return a :class:`libtree.core.node_data.NodeData` object for current node ID from database. """ return core.get_node(self._cursor, self.id)
def __eq__(self, other): if other.__class__ == Node: nd_self = self._node_data nd_other = core.get_node(self._cursor, other.id) return nd_self.to_dict() == nd_other.to_dict() return False
def node_data(self): """ Get a :class:`libtree.core.node_data.NodeData` object for current node ID from database. """ return core.get_node(self._cursor, self.id)