multiget_cache/function_tools.py
def map_arguments_to_objects(kwargs, objects, object_key, object_tuple_key, argument_key, result_value, default_result):
    """
    :param kwargs: kwargs used to call the multiget function
    :param objects: objects returned from the inner function
    :param object_key: field or set of fields that map to the kwargs provided
    :param object_tuple_key: A temporary shortcut until we allow dot.path traversal for object_key.
    Will call getattr(getattr(result, join_table_name), object_key)
    :param argument_key: field or set of fields that map to the objects provided
    :param result_value: Limit the fields returned to this field or set of fields (none = whole object)
    :param default_result: If the inner function returned none for a set of parameters, default to this
    :return:
    """

    # Map each object to the set of desired result data using a key
    # that corresponds to the parameters for ordering purposes
    map_ = map_objects_to_result(objects, object_key, object_tuple_key, result_value, default_result)
    element_count = get_request_count(kwargs)
    # Using the map we just made, return the objects in the same order
    # they were primed using the object and argument keys to match against
    return [map_[get_argument_key(kwargs, argument_key, index)] for index in range(0, element_count)]
def map_arguments_to_objects(kwargs, objects, object_key, object_tuple_key, argument_key, result_value, default_result):
    """
    :param kwargs: kwargs used to call the multiget function
    :param objects: objects returned from the inner function
    :param object_key: field or set of fields that map to the kwargs provided
    :param object_tuple_key: A temporary shortcut until we allow dot.path traversal for object_key.
    Will call getattr(getattr(result, join_table_name), object_key)
    :param argument_key: field or set of fields that map to the objects provided
    :param result_value: Limit the fields returned to this field or set of fields (none = whole object)
    :param default_result: If the inner function returned none for a set of parameters, default to this
    :return:
    """

    # Map each object to the set of desired result data using a key
    # that corresponds to the parameters for ordering purposes
    map_ = map_objects_to_result(objects, object_key, object_tuple_key, result_value, default_result)
    element_count = get_request_count(kwargs)
    # Using the map we just made, return the objects in the same order
    # they were primed using the object and argument keys to match against
    return [map_[get_argument_key(kwargs, argument_key, index)] for index in range(0, element_count)]
:param kwargs: kwargs used to call the multiget function
    :param objects: objects returned from the inner function
    :param object_key: field or set of fields that map to the kwargs provided
    :param object_tuple_key: A temporary shortcut until we allow dot.path traversal for object_key.
    Will call getattr(getattr(result, join_table_name), object_key)
    :param argument_key: field or set of fields that map to the objects provided
    :param result_value: Limit the fields returned to this field or set of fields (none = whole object)
    :param default_result: If the inner function returned none for a set of parameters, default to this
    :return: