def url_replace(request, field, value):
    """URL Replace.

    Allows us to quickly and easily swap parameters in the request
    object in the case of doing complex queries like filtering
    a certain search results, feed, or metadata. Pour exemple:
      <a href="?{% url_replace request 'viewing' 'unanswered' %}" class="feedNav-link">Unanswered</a> # noqa

    And let's pretend the url currently looks like this:
      http://app.dev/feed/?viewing=all&topic=Chronic%20Pain

    Clicking on that link would generate a URL like this:
      http://app.dev/feed/?viewing=unaswered&topic=Chronic%20Pain
    """
    dict_ = request.GET.copy()
    dict_[field] = value
    return dict_.urlencode()