trilium_alchemy.core.entity¶
Class index¶
Canonical
Base class for Trilium entities. |
|
Entity state. |
Symbols¶
- class trilium_alchemy.core.entity.BaseEntity(*, entity_id: str | None = None, session: Session | None = None, backing_model: EtapiModelT | None = None, create: bool | None = None)¶
Bases:
abc.ABC
trilium_alchemy.core.session.SessionContainer
trilium_alchemy.core.entity.model.ModelContainerBase class for Trilium entities.
Should not be instantiated by user, but published for reference.
- property str_summary: str¶
Get a summary of this entity, including its current state and model values.
- flush()¶
Commit changes to Trilium for this entity and its dependencies.
- invalidate()¶
Discard cached contents and user-provided data for this object.
Upon next access, data will be fetched from Trilium.
- delete()¶
Mark this entity for pending delete.
- refresh()¶
Update value from Trilium, discarding any local changes.
- class trilium_alchemy.core.entity.State(*args, **kwds)¶
Bases:
Aliases:
trilium_alchemy.State
trilium_alchemy.core.StateEntity state.
Maintained automatically based on the user’s updates and object’s current state in Trilium.
For example, state will change from
State.UPDATEback toState.CLEANif the user reverts changes.- CLEAN¶
No pending changes.
- CREATE¶
Pending create.
- UPDATE¶
Pending update.
- DELETE¶
Pending delete.