def append_collection_links(request, response, link_dict):
    """
    Convenience method to append to a response object document-level links.
    """
    data = response.data
    if not 'collection_links' in data:
        data['collection_links'] = {}
        
    for (link_relation_name, url) in link_dict.items():
        data['collection_links'][link_relation_name] = url
    return response