Retrieve object indexed by <key> and return it serialized

def dump(self, key):
    
    """
    Retrieve object indexed by <key> and return it serialized
    """

    try:
      
      obj = self.get(key)
      if obj:
        return json.dumps(obj)
      else:
        return None

    except:
      raise