def get_querystring(self):
to_remove = self.get_querystring_parameter_to_remove()<EOL>query_string = urlparse(self.request.get_full_path()).query<EOL>query_dict = parse_qs(query_string.encode('<STR_LIT:utf-8>'))<EOL>for arg in to_remove:<EOL><INDENT>if arg in query_dict:<EOL><INDENT>del query_dict[arg]<EOL><DEDENT><DEDENT>clean_query_string = urlencode(query_dict, doseq=True)<EOL>return clean_query_string<EOL>
Clean existing query string (GET parameters) by removing
arguments that we don't want to preserve (sort parameter, 'page')