Adding fixture system

This commit is contained in:
2025-02-10 22:23:47 +01:00
parent 39c4ab9102
commit 0604cb5cc3
6 changed files with 193 additions and 7 deletions

View File

@@ -27,6 +27,14 @@ class Account(AccountBaseId, table=True):
def is_category(self):
return self.family in [v.value for v in CategoryFamily]
@classmethod
def get_by_path(cls, session, path):
if not path:
return None
return session.exec(select(cls).where(cls.path == path))
def get_parent(self, session):
if self.parent_account_id is None:
return None