def _querystring_to_objects(dictionary): """ Finds all nagios objects in a querystring and returns a list of objects >>> dictionary = {'host':('localhost1', 'localhost2'),} >>> print _querystring_to_objects {'host':('localhost1','localhost2')} """ result = [] Object = namedtuple('Object', 'object_type description') for object_type in string_to_class.keys(): objects = dictionary.getlist(object_type) for i in objects: obj = (Object(object_type, i)) result.append(obj) return result