def get_params_for_field(self, field_name, sort_type=None):
if not sort_type:<EOL><INDENT>if self.initial_sort == field_name:<EOL><INDENT>sort_type = '<STR_LIT>' if self.initial_sort_type == '<STR_LIT>' else '<STR_LIT>'<EOL><DEDENT>else:<EOL><INDENT>sort_type = '<STR_LIT>'<EOL><DEDENT><DEDENT>self.initial_params[self.sort_param_name] = self.sort_fields[field_name]<EOL>self.initial_params[self.sort_type_param_name] = sort_type<EOL>return '<STR_LIT>' % self.initial_params.urlencode()<EOL>
If sort_type is None - inverse current sort for field, if no sorted - use asc