@register.filter
def pop_from_GET(obj, attr):
 if obj.get(attr, None):
  obj_copy = obj.copy()
  del obj_copy[attr]
  return ('&%s' % obj_copy.urlencode())
 if (not obj):
  return ''
 return ('&%s' % obj.urlencode())

@ register . filter def pop_from_GET ( obj , attr ) : if obj . get ( attr , None ) : obj_copy = obj . copy ( ) del obj_copy [ attr ] return ( '&%s' % obj_copy . urlencode ( ) ) if ( not obj ) : return '' return ( '&%s' % obj . urlencode ( ) )
returns get parameters sans specified attribute .