#NEWLINE# def get_querystring_for_page( request , page_number , querystring_key , default_number = 1 ) : #NEWLINE# #INDENT# 'Return a querystring pointing to *page_number*.' #NEWLINE# querydict = request . GET . copy ( ) #NEWLINE# querydict [ querystring_key ] = page_number #NEWLINE# if ( page_number == default_number ) : #NEWLINE# #INDENT# del querydict [ querystring_key ] #NEWLINE# #UNINDENT# if ( 'querystring_key' in querydict ) : #NEWLINE# #INDENT# del querydict [ 'querystring_key' ] #NEWLINE# #UNINDENT# if querydict : #NEWLINE# #INDENT# return ( '?' + querydict . urlencode ( ) ) #NEWLINE# #UNINDENT# return ''