(data_list, display_field)
return sorted(
        data_list,
        key=lambda x: sort_helper(x, position, sort_type),
        reverse=is_reverse
    )
Sort data based on display_field settings
    data_list - 2d array of data
    display_field - report_builder.DisplayField object
    returns sorted data_list
Sort data based on display_field settings
    data_list - 2d array of data
    display_field - report_builder.DisplayField object
    returns sorted data_list
Sort data based on display_field settings data_list - 2d array of data display_field - report_builder . DisplayField object returns sorted data_list
def sort_data(data_list, display_field):
    """ Sort data based on display_field settings
    data_list - 2d array of data
    display_field - report_builder.DisplayField object
    returns sorted data_list
    """
    position = display_field.position
    is_reverse = display_field.sort_reverse
    # Try to inspect sample data to determine type
    sample_data = data_list[0][position]
    if sample_data is None:
        sample_data = data_list[-1][position]
    sort_type = None
    if isinstance(sample_data, (datetime.date, datetime.datetime)):
        sort_type = DATE
    elif isinstance(sample_data, (int, float, complex)):
        sort_type = NUMBER
    return sorted(
        data_list,
        key=lambda x: sort_helper(x, position, sort_type),
        reverse=is_reverse
    )
def sort_data ( data_list , display_field ) : position = display_field . position is_reverse = display_field . sort_reverse # Try to inspect sample data to determine type sample_data = data_list [ 0 ] [ position ] if sample_data is None : sample_data = data_list [ - 1 ] [ position ] sort_type = None if isinstance ( sample_data , ( datetime . date , datetime . datetime ) ) : sort_type = DATE elif isinstance ( sample_data , ( int , float , complex ) ) : sort_type = NUMBER return sorted ( data_list , key = lambda x : sort_helper ( x , position , sort_type ) , reverse = is_reverse )