nodes: 0, module; 1, function_definition; 2, function_name:_sort_to_str; 3, parameters; 4, block; 5, identifier:self; 6, expression_statement; 7, expression_statement; 8, expression_statement; 9, for_statement; 10, expression_statement; 11, expression_statement; 12, comment:"""
          Before exec query, this method transforms sort dict string
  
          from
  
              {"name": "asc", "timestamp":"desc"}
  
          to
  
              "name asc, timestamp desc"
          """; 13, assignment; 14, assignment; 15, pattern_list; 16, call; 17, block; 18, call; 19, assignment; 20, identifier:params_list; 21, list; 22, identifier:timestamp; 23, string:""; 24, identifier:k; 25, identifier:v; 26, attribute; 27, argument_list; 28, if_statement; 29, attribute; 30, argument_list; 31, subscript; 32, call; 33, subscript; 34, identifier:items; 35, comparison_operator:k != "timestamp"; 36, block; 37, else_clause; 38, identifier:params_list; 39, identifier:append; 40, call; 41, attribute; 42, string; 43, attribute; 44, argument_list; 45, attribute; 46, string; 47, identifier:k; 48, string:"timestamp"; 49, expression_statement; 50, block; 51, attribute; 52, argument_list; 53, identifier:self; 54, identifier:_solr_params; 55, string_content:sort; 56, string:", "; 57, identifier:join; 58, identifier:params_list; 59, identifier:self; 60, identifier:_solr_params; 61, string_content:sort; 62, call; 63, expression_statement; 64, string:" "; 65, identifier:join; 66, list; 67, attribute; 68, argument_list; 69, assignment; 70, string; 71, identifier:timestamp; 72, identifier:params_list; 73, identifier:append; 74, call; 75, identifier:timestamp; 76, identifier:v; 77, string_content:timestamp; 78, attribute; 79, argument_list; 80, string:" "; 81, identifier:join; 82, list; 83, identifier:k; 84, identifier:v
code: def _sort_to_str(self):
          """
          Before exec query, this method transforms sort dict string
  
          from
  
              {"name": "asc", "timestamp":"desc"}
  
          to
  
              "name asc, timestamp desc"
          """
  
          params_list = []
          timestamp = ""
  
          for k, v in self._solr_params['sort'].items():
              if k != "timestamp":
                  params_list.append(" ".join([k, v]))
              else:
                  timestamp = v
  
          params_list.append(" ".join(['timestamp', timestamp]))
  
          self._solr_params['sort'] = ", ".join(params_list)