def normalize_config_ordering(self, config, query_config):
        # For "n" columns (iSortingCols), the queried values iSortCol_0..iSortCol_n are used as
        # column indices to check the values of sSortDir_X and bSortable_X

        default_ordering = config['ordering']
        ordering = []
        columns_list = list(self.columns.values())

        try:
            num_sorting_columns = int(query_config.get(OPTION_NAME_MAP['num_sorting_columns'], 0))
        except ValueError:
            num_sorting_columns = 0

        # Default sorting from view or model definition
        if num_sorting_columns == 0:
            return default_ordering

        for sort_queue_i in range(num_sorting_columns):
            try:
                column_index = int(query_config.get(OPTION_NAME_MAP['sort_column'] % sort_queue_i, ''))
            except __HOLE__:
                continue

            # Reject out-of-range sort requests
            if column_index >= len(columns_list):
                continue

            column = columns_list[column_index]

            # Reject requests for unsortable columns
            if column.name in config['unsortable_columns']:
                continue

            sort_direction = query_config.get(OPTION_NAME_MAP['sort_column_direction'] % sort_queue_i, None)

            sort_modifier = None
            if sort_direction == 'asc':
                sort_modifier = ''
            elif sort_direction == 'desc':
                sort_modifier = '-'
            else:
                # Aggressively skip invalid specification
                continue

            ordering.append('%s%s' % (sort_modifier, column.name))

        if not ordering and config['model']:
            return config['model']._meta.ordering
        return ordering
dataset/ETHPy150Open pivotal-energy-solutions/django-datatable-view/datatableview/datatables.py/Datatable.normalize_config_ordering