def url_replace_pop(request, field, value):
    """Remove a value from the GET dictionary and return it urlencoded."""
    dict_ = request.GET.copy()
    list_ = dict_.pop(field)
    dict_.setlist(field, [v for v in list_ if v != value])
    return dict_.urlencode()