TimelinkNotebook exposes TimelinkDatabase methods get_personget_entity but these return unbound instances that need to be
attached to session to be used in most use cases:
What I Did
p = tlnb.db.get_person(id)
print(p.to_kleio())
---
---------------------------------------------------------------------------
DetachedInstanceError Traceback (most recent call last)
Cell In[13], [line 2](vscode-notebook-cell:?execution_count=13&line=2)
[1](vscode-notebook-cell:?execution_count=13&line=1) p = tlnb.db.get_person(id)
----> [2](vscode-notebook-cell:?execution_count=13&line=2) print(p.to_kleio())
DetachedInstanceError: Parent instance <Person at 0x14007f250> is not bound to a Session; lazy load operation of attribute 'contains' cannot proceed (Background on this error at: https://sqlalche.me/e/20/bhk3)
It should be possible to do
with tlnb.db.session() as session:
p = tlnb.db.get_person(id)
print(p.to_kleio())
Description
TimelinkNotebook exposes TimelinkDatabase methods
get_person
get_entity
but these return unbound instances that need to be attached to session to be used in most use cases:What I Did
It should be possible to do