This is an automated email from the ASF dual-hosted git repository.

gstein pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/steve.git


The following commit(s) were added to refs/heads/trunk by this push:
     new ded159a  add methods to list all voters/issues
ded159a is described below

commit ded159afd2d1ab48eecfdb67b64acafa9a69b474
Author: Greg Stein <[email protected]>
AuthorDate: Mon May 30 21:19:11 2022 -0500

    add methods to list all voters/issues
---
 v3/steve/election.py | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/v3/steve/election.py b/v3/steve/election.py
index 9e7b2c9..0d606f3 100644
--- a/v3/steve/election.py
+++ b/v3/steve/election.py
@@ -177,6 +177,11 @@ class Election:
 
         self.c_delete_issue.perform((iid,))
 
+    def list_issues(self):
+        "Return ordered (IID, TITLE, DESCRIPTION, TYPE, KV) for all ISSUES."
+        self.q_issues.perform()
+        return [ row[:5] for row in self.q_issues.fetchall() ]
+
     def get_participant(self, rid):
         "Return NAME, EMAIL for Participant on record RID."
 
@@ -198,6 +203,11 @@ class Election:
 
         self.c_delete_record.perform((rid,))
 
+    def list_participants(self):
+        "Return ordered (RID, NAME, EMAIL) for each Participant in RECORD."
+        self.q_record.perform()
+        return [ row[:3] for row in self.q_record.fetchall() ]
+
     def add_vote(self, rid, iid, votestring):
         "Add VOTESTRING as the (latest) vote by RID for IID."
 

Reply via email to