def __init__(self, implicit_output_name=None, job=None, hid=1): self.id = 124 self.copied_from_history_dataset_collection_association = None self.history_content_type = "dataset_collection" self.implicit_output_name = implicit_output_name self.hid = 1 self.collection = model.DatasetCollection() self.creating_job_associations = [] element = model.DatasetCollectionElement( collection=self.collection, element=model.HistoryDatasetAssociation(), element_index=0, element_identifier="moocow", ) element.dataset_instance.dataset = model.Dataset() element.dataset_instance.dataset.state = "ok" creating = model.JobToOutputDatasetAssociation( implicit_output_name, element.dataset_instance, ) creating.job = job element.dataset_instance.creating_job_associations = [ creating, ] self.collection.elements = [element]
def __init__(self, state='ok', output_name='out1', job=None): self.id = 123 self.state = state self.copied_from_history_dataset_association = None if job is not UNDEFINED_JOB: if not job: job = model.Job() self.job = job assoc = model.JobToOutputDatasetAssociation(output_name, self) assoc.job = job self.creating_job_associations = [assoc] else: self.creating_job_associations = []