#NEWLINE# def get_params_for_field( self , field_name , sort_type = None ) : #NEWLINE# #INDENT# '\n        If sort_type is None - inverse current sort for field, if no sorted - use asc\n        ' #NEWLINE# if ( not sort_type ) : #NEWLINE# #INDENT# if ( self . initial_sort == field_name ) : #NEWLINE# #INDENT# sort_type = ( 'desc' if ( self . initial_sort_type == 'asc' ) else 'asc' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# sort_type = 'asc' #NEWLINE# #UNINDENT# #UNINDENT# self . initial_params [ self . sort_param_name ] = self . sort_fields [ field_name ] #NEWLINE# self . initial_params [ self . sort_type_param_name ] = sort_type #NEWLINE# return ( '?%s' % self . initial_params . urlencode ( ) )