def map_items_to_parent(items, parents):
    """Groups all items into a list based on thier respective parent

    ex: pages have request, runs have pages
    """
    item_lists = {}
    if len(parents) > 0:
        pk = parents.values()[0].pk
        for p_id in parents:
            item_lists[p_id] = []
        for item_id, item in items.iteritems():
            p_id = item.data[pk]
            if p_id in item_lists:
                item_lists[p_id].append(item)

    return item_lists