code: def delete(self, key):
      '''Removes the object named by `key`.
         DirectoryTreeDatastore removes the directory entry.
      '''
      super(DirectoryTreeDatastore, self).delete(key)
  
      str_key = str(key)
  
      # ignore root
      if str_key == '/':
        return
  
      # retrieve directory, to remove entry
      dir_key = key.parent.instance('directory')
      directory = self.directory(dir_key)
  
      # ensure key is not in directory
      if directory and str_key in directory:
        directory.remove(str_key)
        if len(directory) > 0:
          super(DirectoryTreeDatastore, self).put(dir_key, directory)
        else:
          super(DirectoryTreeDatastore, self).delete(dir_keyf delete(self, key):
      '''Removes the object named by `key`.
         DirectoryTreeDatastore removes the directory entry.
      '''
      super(DirectoryTreeDatastore, self).delete(key)
  
      str_key = str(key)
  
      # ignore root
      if str_key == '/':
        return
  
      # retrieve directory, to remove entry
      dir_key = key.parent.instance('directory')
      directory = self.directory(dir_key)
  
      # ensure key is not in directory
      if directory and str_key in directory:
        directory.remove(str_key)
        if len(directory) > 0:
          super(DirectoryTreeDatastore, self).put(dir_key, directory)
        else:
          super(DirectoryTreeDatastore, self).delete(dir_key)
docs: Removes the object named by `key`.
         DirectoryTreeDatastore removes the directory entry.