'Connect this instance to the hierarchy'

def __connect(self):

    tablename = self.tablename
    if tablename:
        hierarchies = current.model.hierarchies
        if (tablename in hierarchies):
            hierarchy = hierarchies[tablename]
            self.__theset = hierarchy['nodes']
            self.__flags = hierarchy['flags']
        else:
            self.__theset = dict()
            self.__flags = dict()
            self.load()
            hierarchy = {'nodes': self.__theset, 'flags': self.__flags}
            hierarchies[tablename] = hierarchy
    else:
        self.__theset = dict()
        self.__flags = dict()
    return
