@register.simple_tag(takes_context=True)
def modify_query_string(context, **kwargs):
    """
    Returns the current URL with modified query string.
    """
    qs = dict([(k, v) for k, v in context['request'].GET.items()])
    qs.update(kwargs)
    if qs in 'page' and qs['page'] == 1:
        del qs['page']
    return '%s%s%s' % (
        context['request'].path,
        '?' if qs else '',
        urlencode(qs),
    )
dataset/ETHPy150Open 2buntu/2buntu-blog/twobuntu/articles/templatetags/pagination.py/modify_query_string/swapped operands of `in`