Adding fixture system
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user