def get_sort_params(value, default_key=None):
    """Parse a string into a list of sort_keys and a list of sort_dirs.

    :param value: A string that contains the sorting parameters.
    :param default_key: An optional key set as the default sorting key when
                        no sorting option value is specified.

    :return: A list of sorting keys and a list of sorting dirs.
    """
    keys = []
    dirs = []
    if value:
        for s in value.split(','):
            s_key, _s, s_dir = s.partition(':')
            keys.append(s_key)
            s_dir = s_dir or 'asc'
            nulls_appendix = 'nullsfirst' if s_dir == 'asc' else 'nullslast'
            sort_dir = '-'.join([s_dir, nulls_appendix])
            dirs.append(sort_dir)
    elif default_key:
        # use default if specified
        return [default_key, 'id'], ['asc-nullsfirst', 'asc']

    if 'id' not in keys:
        keys.append('id')
        dirs.append('asc')

    return keys, dirs