'Generate a select list containing the columns of the associated
dataset (if found).'

def get_column_list(self, trans, other_values):

    dataset = other_values.get(self.data_ref, None)
    if (not dataset):
        return []
    column_list = None
    for dataset in util.listify(dataset):
        if isinstance(dataset, trans.app.model.HistoryDatasetCollectionAssociation):
            dataset = dataset.to_hda_representative()
        if ((not hasattr(dataset, 'metadata')) or (not hasattr(dataset.metadata, 'columns')) or (not dataset.metadata.columns)):
            return []
        this_column_list = []
        if self.numerical:
            for (i, col) in enumerate(dataset.metadata.column_types):
                if ((col == 'int') or (col == 'float')):
                    this_column_list.append(str((i + 1)))
        else:
            for i in range(0, dataset.metadata.columns):
                this_column_list.append(str((i + 1)))
        if (column_list is None):
            column_list = this_column_list
        else:
            column_list = [c for c in column_list if (c in this_column_list)]
    return column_list
