trilium_alchemy.core.branch
#
Class index#
Canonical
Encapsulates a branch, a parent-child association between notes. |
Symbols#
- class trilium_alchemy.core.branch.Branch(parent: Note = None, child: Note = None, prefix: str = '', expanded: bool = False, session: Session = None, **kwargs)#
- Parameters:
Bases:
trilium_alchemy.core.entity.Entity
Aliases:
trilium_alchemy.Branch
trilium_alchemy.core.Branch
Encapsulates a branch, a parent-child association between notes.
Implicitly created by operations documented in
Note
andBranches
. Can also be explicitly created and added to a note using its+=
operator:# add child note with prefix note += Branch(child=Note(title="Child note"), prefix="Child branch prefix") # add parent note (cloning the note) with prefix note += Branch(parent=session.root, prefix="Parent branch prefix")
- position: int#
-
Read-only access to position of this attribute.
Note
This is maintained automatically based on the order of this attribute in its note’s
Note.branches.children
list.
- property state: State#
Inherited from:
trilium_alchemy.core.entity.Entity
Current state.
- property session: Session#
Inherited from:
trilium_alchemy.core.entity.Entity
Session to which this entity belongs.
- property str_short: str#
Inherited from:
trilium_alchemy.core.entity.Entity
Get a short description of this entity.
- property str_summary: str#
Inherited from:
trilium_alchemy.core.entity.Entity
Get a summary of this entity, including its current state and model values.
- flush() None #
Inherited from:
trilium_alchemy.core.entity.Entity
Commit changes to Trilium for this entity and its dependencies.
- invalidate() None #
Inherited from:
trilium_alchemy.core.entity.Entity
Discard cached contents and user-provided data for this object. Upon next access, data will be fetched from Trilium.
- delete() None #
Inherited from:
trilium_alchemy.core.entity.Entity
Mark this entity for pending delete.