@register.simple_tag
def filter_url(request, the_filter, the_value):
    getvars = request.GET.copy()
    getvars[the_filter] = the_value
    return (request.path, getvars.urlencode()) % "%s?%s"
dataset/ETHPy150Open caseywstark/colab/colab/apps/issues/templatetags/issues_tags.py/filter_url/swapped operands of `%`