def faceted_next_prev_querystring(request, page_number):
    """"Returns a string that provides the querystring required to paginate in
        search results while retaining the selected facets

        Example:
            {% load facet_tags %}
            {% faceted_next_prev_querystring request page_number %}

        Renders:
           ?q=text&page=N&selected_facets=facet:value
    """
    q_dict = request.GET.copy()
    q_dict['page'] = page_number
    qs = '?%s' % q_dict.urlencode()
    return qs