def split_sortby(sort_by):
    """"Split the value of sortBy.
    
    sortBy can have a trailing 'ASC' oder 'DESC'. 
    This function returns the fieldname and 'ASC' or 'DESC' as tuple.
    """
    asc_desc = 'ASC'
    if sort_by.lower().endswith('asc'):
        sort_by_value = sort_by[:-3]
    elif sort_by.lower().endswith('desc'):
        sort_by_value = sort_by[:-4]
        asc_desc = 'DESC'
    else:
        sort_by_value = sort_by
    return sort_by_value, asc_desc