(context, field, value)
return params.urlencode()
Usage <a href="?{% url_replace 'since' restore_id %}">
    will replace the 'since' parameter in the url with <restore_id>
    note the presense of the '?' in the href value

    http://stackoverflow.com/a/16609591/2957657
Usage <a href="?{% url_replace 'since' restore_id %}">
    will replace the 'since' parameter in the url with <restore_id>
    note the presense of the '?' in the href value
Usage <a href = ? { % url_replace since restore_id % } > will replace the since parameter in the url with <restore_id > note the presense of the ? in the href value
def url_replace(context, field, value):
    """Usage <a href="?{% url_replace 'since' restore_id %}">
    will replace the 'since' parameter in the url with <restore_id>
    note the presense of the '?' in the href value

    http://stackoverflow.com/a/16609591/2957657
    """
    params = context['request'].GET.copy()
    params[field] = value
    return params.urlencode()
def url_replace ( context , field , value ) : params = context [ 'request' ] . GET . copy ( ) params [ field ] = value return params . urlencode ( )