'Before using sort_results(), handle special ordering cases
for some fields'

def __specialized_sort(self, query, order_by, order_dir):

    if (order_by == 'severity'):
        column_map = {'severity': [case({'unclassified': 0, 'info': 1, 'low': 2, 'med': 3, 'high': 4, 'critical': 5}, value=Vulnerability.severity)]}
    else:
        column_map = self.COLUMNS_MAP
    return sort_results(query, column_map, order_by, order_dir, default=Vulnerability.id)
