nodes: 0, module; 1, function_definition; 2, function_name:get_name; 3, parameters; 4, block; 5, identifier:self; 6, default_parameter; 7, expression_statement; 8, if_statement; 9, if_statement; 10, return_statement; 11, identifier:use_alias; 12, True; 13, comment:"""
          Gets the name to reference the sorted field
  
          :return: the name to reference the sorted field
          :rtype: str
          """; 14, attribute; 15, block; 16, else_clause; 17, identifier:use_alias; 18, block; 19, call; 20, identifier:self; 21, identifier:desc; 22, expression_statement; 23, block; 24, return_statement; 25, attribute; 26, argument_list; 27, assignment; 28, expression_statement; 29, call; 30, string; 31, identifier:format; 32, call; 33, identifier:direction; 34, identifier:direction; 35, string; 36, assignment; 37, attribute; 38, argument_list; 39, string_content:{0} {1}; 40, attribute; 41, argument_list; 42, string_content:DESC; 43, identifier:direction; 44, string; 45, string; 46, identifier:format; 47, call; 48, identifier:direction; 49, attribute; 50, identifier:get_select_sql; 51, string_content:ASC; 52, string_content:{0} {1}; 53, attribute; 54, argument_list; 55, identifier:self; 56, identifier:field; 57, attribute; 58, identifier:get_identifier; 59, identifier:self; 60, identifier:field
code: def get_name(self, use_alias=True):
          """
          Gets the name to reference the sorted field
  
          :return: the name to reference the sorted field
          :rtype: str
          """
          if self.desc:
              direction = 'DESC'
          else:
              direction = 'ASC'
  
          if use_alias:
              return '{0} {1}'.format(self.field.get_identifier(), direction)
          return '{0} {1}'.format(self.field.get_select_sql(), direction)