[Cell] return all datasets pointing to itself

This commit is contained in:
Jan Grewe 2019-10-01 16:58:54 +02:00
parent 0f46fa1431
commit 77c0460ca9

View File

@ -55,6 +55,10 @@ class Cell:
def subject(self):
return Subject(tuple=(Subjects & {"subject_id": self.__tuple["subject_id"]}).fetch(limit=1, as_dict=True)[0])
@property
def datasets(self):
return [Dataset(tuple=d) for d in (Datasets & (CellDatasetMap & self.id)).fetch(as_dict=True)]
@property
def repro_runs(self):
repros = (Repros & "cell_id = '%s'" % self.id)