Added the match pseudo property to the JournalEntryLineItem data model.

This commit is contained in:
依瑪貓 2023-04-08 14:08:13 +08:00
parent a8f318b0bb
commit 428018e4a9

View File

@ -788,6 +788,25 @@ class JournalEntryLineItem(db.Model):
setattr(self, "__offsets", offsets)
return getattr(self, "__offsets")
@property
def match(self) -> t.Self | None:
"""Returns the match of the line item.
:return: The match of the line item.
"""
if not hasattr(self, "__match"):
setattr(self, "__match", None)
return getattr(self, "__match")
@match.setter
def match(self, match: t.Self) -> None:
"""Sets the match of the line item.
:param match: The matcho of the line item.
:return: None.
"""
setattr(self, "__match", match)
@property
def query_values(self) -> list[str]:
"""Returns the values to be queried.