Added the "count" pseudo property to the Account data model.
This commit is contained in:
parent
ac3b5523b1
commit
e5cc2b5a2f
@ -214,6 +214,25 @@ class Account(db.Model):
|
||||
"""
|
||||
return not self.is_real
|
||||
|
||||
@property
|
||||
def count(self) -> int:
|
||||
"""Returns the number of items in the account.
|
||||
|
||||
:return: The number of items in the account.
|
||||
"""
|
||||
if not hasattr(self, "__count"):
|
||||
setattr(self, "__count", 0)
|
||||
return getattr(self, "__count")
|
||||
|
||||
@count.setter
|
||||
def count(self, count: int) -> None:
|
||||
"""Sets the number of items in the account.
|
||||
|
||||
:param count: The number of items in the account.
|
||||
:return: None.
|
||||
"""
|
||||
setattr(self, "__count", count)
|
||||
|
||||
@property
|
||||
def query_values(self) -> list[str]:
|
||||
"""Returns the values to be queried.
|
||||
|
Loading…
Reference in New Issue
Block a user