Hi,
conn.getObject() is expected to return a single item. It will throw an exception if more than one object is returned, since it uses queryService.findByQuery(query, params)
E.g.
- Code: Select all
conn.getObject("Image", attributes={"name", "myImage.tiff"})
will throw if there is more than one image of that name.
It will also throw an AttributeError if the string is not supported. Supported strings are mapped to the wrapper used to wrap the returned object. They are, by default:
- Code: Select all
KNOWN_WRAPPERS.update({"project":ProjectWrapper,
"dataset":DatasetWrapper,
"image":ImageWrapper,
"screen":ScreenWrapper,
"plate":PlateWrapper,
"plateacquisition": PlateAcquisitionWrapper,
"well":WellWrapper,
"experimenter":ExperimenterWrapper,
"experimentergroup":ExperimenterGroupWrapper,
"originalfile":OriginalFileWrapper,
"commentannotation":CommentAnnotationWrapper,
"tagannotation":TagAnnotationWrapper,
"longannotation":LongAnnotationWrapper,
"booleanannotation":BooleanAnnotationWrapper,
"fileannotation":FileAnnotationWrapper,
"doubleannotation":DoubleAnnotationWrapper,
"termannotation":TermAnnotationWrapper,
"timestampannotation":TimestampAnnotationWrapper,
"annotation":AnnotationWrapper._wrap})