def query_transform(request, **kwargs):
    """Alter parameters in a query string while keeping the rest."""
    updated = request.GET.copy()
    for field, value in kwargs.items():
        updated[field] = value

    return updated.urlencode()