nodes: 0, module; 1, function_definition; 2, function_name:get_sort_spec; 3, parameters; 4, block; 5, identifier:self; 6, expression_statement; 7, expression_statement; 8, expression_statement; 9, expression_statement; 10, return_statement; 11, comment:"""Build sort specification
          """; 12, assignment; 13, assignment; 14, assignment; 15, expression_list; 16, identifier:all_indexes; 17, call; 18, identifier:si; 19, call; 20, identifier:so; 21, call; 22, identifier:si; 23, identifier:so; 24, attribute; 25, argument_list; 26, attribute; 27, argument_list; 28, attribute; 29, argument_list; 30, attribute; 31, identifier:get_indexes; 32, identifier:req; 33, identifier:get_sort_on; 34, keyword_argument; 35, identifier:req; 36, identifier:get_sort_order; 37, identifier:self; 38, identifier:catalog; 39, identifier:allowed_indexes; 40, identifier:all_indexes
code: def get_sort_spec(self):
          """Build sort specification
          """
          all_indexes = self.catalog.get_indexes()
          si = req.get_sort_on(allowed_indexes=all_indexes)
          so = req.get_sort_order()
          return si, so