'Returns history\'s datasets.'

def get_history_datasets(self, trans, history):

    query = trans.sa_session.query(trans.model.HistoryDatasetAssociation).filter((trans.model.HistoryDatasetAssociation.history == history)).options(eagerload('children')).join('dataset').options(eagerload_all('dataset.actions')).order_by(trans.model.HistoryDatasetAssociation.hid).filter((trans.model.HistoryDatasetAssociation.deleted == expression.false())).filter((trans.model.Dataset.purged == expression.false()))
    return query.all()
