Adding fixture system

This commit is contained in:
2025-02-10 22:23:47 +01:00
parent 39c4ab9102
commit ed6be838fe
5 changed files with 192 additions and 10 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