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.OrderedEntity
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")
- property position: int¶
Getter for position of this branch.
Note
This is maintained automatically based on the order of this branch in its parent note’s
Note.branches.children
list.
- property state: State¶
Inherited from:
trilium_alchemy.core.entity.BaseEntity
Current state.
- property session: Session¶
Inherited from:
trilium_alchemy.core.entity.BaseEntity
Session to which this entity belongs.
- property str_short: str¶
Inherited from:
trilium_alchemy.core.entity.BaseEntity
Get a short description of this entity.
- property str_summary: str¶
Inherited from:
trilium_alchemy.core.entity.BaseEntity
Get a summary of this entity, including its current state and model values.
- flush()¶
Inherited from:
trilium_alchemy.core.entity.BaseEntity
Commit changes to Trilium for this entity and its dependencies.
- invalidate()¶
Inherited from:
trilium_alchemy.core.entity.BaseEntity
Discard 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.BaseEntity
Mark this entity for pending delete.
- refresh()¶
Inherited from:
trilium_alchemy.core.entity.BaseEntity
Update value from Trilium, discarding any local changes.