trilium_alchemy.core.attribute¶
Class index¶
Canonical
Encapsulates an attribute, a key-value record attached to a note. |
|
Encapsulates a label. |
|
Encapsulates a relation. |
Symbols¶
- class trilium_alchemy.core.attribute.BaseAttribute(name: str, inheritable: bool = False, session: Session | None = None, _attribute_id: str | None = None, _owning_note: Note | None = None, _model_backing: AttributeModel | None = None)¶
Bases:
trilium_alchemy.core.entity.entity.OrderedEntity
abc.ABCAliases:
trilium_alchemy.BaseAttribute
trilium_alchemy.core.BaseAttributeEncapsulates an attribute, a key-value record attached to a note.
Can’t be instantiated directly; use
LabelorRelationconcrete classes.Once instantiated, the attribute needs to be added to a
Note. See the documentation ofNotefor details.- property inheritable: bool¶
Getter/setter for whether this attribute is inherited to children and by
template/inheritrelations.
- property note: Note | None¶
Getter for note which owns this attribute, or
Noneif it hasn’t been bound to a note yet.
- property position: int¶
Getter for position of this attribute.
Note
This is maintained automatically based on the order of this attribute in its note’s
Note.attributeslist.
- property state: State¶
Inherited from:
trilium_alchemy.core.entity.BaseEntityCurrent state.
- property session: Session¶
Inherited from:
trilium_alchemy.core.entity.BaseEntitySession to which this entity belongs.
- property str_short: str¶
Inherited from:
trilium_alchemy.core.entity.BaseEntityGet a short description of this entity.
- property str_summary: str¶
Inherited from:
trilium_alchemy.core.entity.BaseEntityGet a summary of this entity, including its current state and model values.
- flush()¶
Inherited from:
trilium_alchemy.core.entity.BaseEntityCommit changes to Trilium for this entity and its dependencies.
- invalidate()¶
Inherited from:
trilium_alchemy.core.entity.BaseEntityDiscard cached contents and user-provided data for this object. Upon next access, data will be fetched from Trilium.
- delete()¶
Inherited from:
trilium_alchemy.core.entity.BaseEntityMark this entity for pending delete.
- refresh()¶
Inherited from:
trilium_alchemy.core.entity.BaseEntityUpdate value from Trilium, discarding any local changes.
- class trilium_alchemy.core.attribute.Label(name: str, value: str = '', inheritable: bool = False, session: Session | None = None, **kwargs)¶
- Parameters:
Bases:
trilium_alchemy.core.attribute.BaseAttributeAliases:
trilium_alchemy.Label
trilium_alchemy.core.LabelEncapsulates a label.
Once instantiated, the label needs to be added to a
Note; see Attributes for details.- property attribute_id: str | None¶
Inherited from:
trilium_alchemy.core.attribute.BaseAttributeGetter for
attributeId, orNoneif not created yet.
- property name: str¶
Inherited from:
trilium_alchemy.core.attribute.BaseAttributeGetter for attribute name.
- property inheritable: bool¶
Inherited from:
trilium_alchemy.core.attribute.BaseAttributeGetter/setter for whether this attribute is inherited to children and by
template/inheritrelations.
- property utc_date_modified: str¶
Inherited from:
trilium_alchemy.core.attribute.BaseAttributeUTC modified datetime, e.g.
2021-12-31 19:18:11.939Z.
- property note: Note | None¶
Inherited from:
trilium_alchemy.core.attribute.BaseAttributeGetter for note which owns this attribute, or
Noneif it hasn’t been bound to a note yet.
- property position: int¶
Inherited from:
trilium_alchemy.core.attribute.BaseAttributeGetter for position of this attribute.
Note
This is maintained automatically based on the order of this attribute in its note’s
Note.attributeslist.
- property state: State¶
Inherited from:
trilium_alchemy.core.entity.BaseEntityCurrent state.
- property session: Session¶
Inherited from:
trilium_alchemy.core.entity.BaseEntitySession to which this entity belongs.
- property str_short: str¶
Inherited from:
trilium_alchemy.core.entity.BaseEntityGet a short description of this entity.
- property str_summary: str¶
Inherited from:
trilium_alchemy.core.entity.BaseEntityGet a summary of this entity, including its current state and model values.
- flush()¶
Inherited from:
trilium_alchemy.core.entity.BaseEntityCommit changes to Trilium for this entity and its dependencies.
- invalidate()¶
Inherited from:
trilium_alchemy.core.entity.BaseEntityDiscard cached contents and user-provided data for this object. Upon next access, data will be fetched from Trilium.
- delete()¶
Inherited from:
trilium_alchemy.core.entity.BaseEntityMark this entity for pending delete.
- refresh()¶
Inherited from:
trilium_alchemy.core.entity.BaseEntityUpdate value from Trilium, discarding any local changes.
- class trilium_alchemy.core.attribute.Relation(name: str, target: Note | None = None, inheritable: bool = False, session: Session | None = None, **kwargs)¶
- Parameters:
Bases:
trilium_alchemy.core.attribute.BaseAttributeAliases:
trilium_alchemy.Relation
trilium_alchemy.core.RelationEncapsulates a relation.
Once instantiated, the relation needs to be added to a
Note; see Attributes for details.- property target: Note¶
Getter/setter for target note, with getter validating that the target has already been assigned.
- property attribute_id: str | None¶
Inherited from:
trilium_alchemy.core.attribute.BaseAttributeGetter for
attributeId, orNoneif not created yet.
- property name: str¶
Inherited from:
trilium_alchemy.core.attribute.BaseAttributeGetter for attribute name.
- property inheritable: bool¶
Inherited from:
trilium_alchemy.core.attribute.BaseAttributeGetter/setter for whether this attribute is inherited to children and by
template/inheritrelations.
- property utc_date_modified: str¶
Inherited from:
trilium_alchemy.core.attribute.BaseAttributeUTC modified datetime, e.g.
2021-12-31 19:18:11.939Z.
- property note: Note | None¶
Inherited from:
trilium_alchemy.core.attribute.BaseAttributeGetter for note which owns this attribute, or
Noneif it hasn’t been bound to a note yet.
- property position: int¶
Inherited from:
trilium_alchemy.core.attribute.BaseAttributeGetter for position of this attribute.
Note
This is maintained automatically based on the order of this attribute in its note’s
Note.attributeslist.
- property state: State¶
Inherited from:
trilium_alchemy.core.entity.BaseEntityCurrent state.
- property session: Session¶
Inherited from:
trilium_alchemy.core.entity.BaseEntitySession to which this entity belongs.
- property str_short: str¶
Inherited from:
trilium_alchemy.core.entity.BaseEntityGet a short description of this entity.
- property str_summary: str¶
Inherited from:
trilium_alchemy.core.entity.BaseEntityGet a summary of this entity, including its current state and model values.
- flush()¶
Inherited from:
trilium_alchemy.core.entity.BaseEntityCommit changes to Trilium for this entity and its dependencies.
- invalidate()¶
Inherited from:
trilium_alchemy.core.entity.BaseEntityDiscard cached contents and user-provided data for this object. Upon next access, data will be fetched from Trilium.
- delete()¶
Inherited from:
trilium_alchemy.core.entity.BaseEntityMark this entity for pending delete.
- refresh()¶
Inherited from:
trilium_alchemy.core.entity.BaseEntityUpdate value from Trilium, discarding any local changes.