Traits¶
The item models in datalab are assembled from traits: small mixin models that each contribute a related group of fields. Rather than every item type redeclaring who owns it or which collections it belongs to, it inherits the corresponding trait.
HasBlocks
¶
HasFiles
¶
HasOwner
¶
Bases: BaseModel
Trait mixin for models that record who created them and which groups can access them.
creator_ids
¶
creator_ids: list[PyObjectId] = []
The database IDs of the user(s) who created the item.
creators
¶
creators: list[Person] | None = None
Inlined info for the people associated with this item.
HasRevisionControl
¶
HasSubstanceInfo
¶
Bases: BaseModel
Trait mixin for models that have substance information.
GHS_codes
¶
GHS_codes: str | None
A string describing any GHS hazard codes associated with this item. See pubchem.ncbi.nlm.nih.gov/ghs/ for code definitions.
chemform
¶
chemform: str | None
A string representation of the chemical formula or composition associated with this sample.
The representation is relatively free-form; clients are expected parse and interpret HTML markup for subscripts and accept unicode characters for greek letters.
HasSynthesisInfo
¶
IsCollectable
¶
Bases: BaseModel
Trait mixin for models that can be added to collections.
collections
¶
collections: list[Collection] = []
Inlined info for the collections associated with this item.