From 716b0146d1f7ad87834b40dfe9a6c2bd66bcd4d6 Mon Sep 17 00:00:00 2001 From: Brian Richard Pauw Date: Thu, 10 Nov 2022 19:00:12 +0100 Subject: [PATCH] small fixes to model and search --- pyscicat/client.py | 4 ++++ pyscicat/model.py | 4 +--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/pyscicat/client.py b/pyscicat/client.py index 667d213..b0e829c 100644 --- a/pyscicat/client.py +++ b/pyscicat/client.py @@ -542,6 +542,10 @@ def datasets_get_many(self, filter_fields=None) -> List[Dataset]: ```python filterField = {"proposalId": ""} ``` + If you want to search on partial strings, you can use "like": + ```python + filterField = {"proposalId": {"like":"123"}} + ``` Parameters ---------- diff --git a/pyscicat/model.py b/pyscicat/model.py index 2cfaf13..bcaab4b 100644 --- a/pyscicat/model.py +++ b/pyscicat/model.py @@ -135,6 +135,7 @@ class Dataset(Ownable): type: DatasetType validationStatus: Optional[str] version: Optional[str] + scientificMetadata: Optional[Dict] class RawDataset(Dataset): @@ -144,13 +145,11 @@ class RawDataset(Dataset): principalInvestigator: Optional[str] creationLocation: Optional[str] - dataFormat: str type: DatasetType = DatasetType.raw dataFormat: Optional[str] endTime: Optional[str] # datetime sampleId: Optional[str] proposalId: Optional[str] - scientificMetadata: Optional[Dict] class DerivedDataset(Dataset): @@ -163,7 +162,6 @@ class DerivedDataset(Dataset): usedSoftware: List[str] jobParameters: Optional[dict] jobLogData: Optional[str] - scientificMetadata: Optional[Dict] type: DatasetType = DatasetType.derived