From 8fd93373d252b55ece4fcaf495144e6b72945889 Mon Sep 17 00:00:00 2001 From: Ion Y Date: Mon, 29 Aug 2022 16:48:37 -0700 Subject: [PATCH] Add IDs to ballot measure contest selections. Fixes BallotLab #86. --- src/electos/ballotmaker/scripts/ballot-lab-data.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/electos/ballotmaker/scripts/ballot-lab-data.py b/src/electos/ballotmaker/scripts/ballot-lab-data.py index 0ddb5d5..a1e1718 100644 --- a/src/electos/ballotmaker/scripts/ballot-lab-data.py +++ b/src/electos/ballotmaker/scripts/ballot-lab-data.py @@ -209,7 +209,10 @@ def extract_ballot_measure_contest(contest: BallotMeasureContest, index): assert isinstance(selection, BallotMeasureSelection), \ f"Unexpected non-ballot measure selection: {type(selection).__name__}" choice = text_content(selection.selection) - choices.append(choice) + choices.append({ + "id": selection.model__id, + "choice": choice, + }) district = contest_election_district(contest, index) full_text = text_content(contest.full_text) result = {