add TUVoteInfo.total_votes()

Returns the sum of TUVoteInfo.Yes, TUVoteInfo.No and
TUVoteInfo.Abstain.

Signed-off-by: Kevin Morris <kevr@0cost.org>
This commit is contained in:
Kevin Morris 2021-06-19 01:18:40 -07:00
parent ac1779b705
commit 83c038a42a
2 changed files with 21 additions and 0 deletions

View file

@ -90,3 +90,6 @@ class TUVoteInfo(Base):
def is_running(self):
return self.End > int(datetime.utcnow().timestamp())
def total_votes(self):
return self.Yes + self.No + self.Abstain