'The number of datasets that were deleted more than the specified number of days ago, but have not yet been purged.'

def deleted_datasets(self, trans, **kwd):

    params = util.Params(kwd)
    message = ''
    if params.deleted_datasets_days:
        deleted_datasets_days = int(params.deleted_datasets_days)
        cutoff_time = (datetime.utcnow() - timedelta(days=deleted_datasets_days))
        dataset_count = 0
        disk_space = 0
        for dataset in trans.sa_session.query(model.Dataset).filter(and_((model.Dataset.table.c.deleted == true()), (model.Dataset.table.c.purged == false()), (model.Dataset.table.c.update_time < cutoff_time))):
            dataset_count += 1
            try:
                disk_space += dataset.file_size
            except:
                pass
        message = ('%d    datasets    were    deleted    more    than    %d    days    ago,    but    have    not    yet    been    purged,    disk    space:    %s.' % (dataset_count, deleted_datasets_days, nice_size(disk_space, True)))
    else:
        message = 'Enter    the    number    of    days.'
    return (str(deleted_datasets_days), message)
