Schulze Results Adapter
Class used to create a schulze results object instance for schulze polls.
SchulzeResultsAdapter
Bases: ISchulzeResults
Class used to manage data for a Schulze poll results
Source code in apps/votes_results/classes/schulze_results/schulze_results_adapter.py
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 | |
all_schulze_rankings: List[List[List[str]]]
class-attribute
List containing all the order rankings of the poll as list of string ids.
schulze_results: List[List[PollOptionModel]]
class-attribute
List containing all the results in the winning order.
schulze_str_options: List[str]
class-attribute
List containing all the options of the poll as list of string ids.
schulze_votes: List[SchulzeVoteModel]
class-attribute
List containing all the votes for the specified schulze poll.
calculate()
Populates the class variables from the poll
Source code in apps/votes_results/classes/schulze_results/schulze_results_adapter.py
33 34 35 36 37 38 39 40 | |
get_sorted_options()
Returns the schulze poll results as list of List of PollOptionModel (in case of parity)
Source code in apps/votes_results/classes/schulze_results/schulze_results_adapter.py
29 30 31 | |
get_votes()
Returns all the schulze votes of the poll as list
Source code in apps/votes_results/classes/schulze_results/schulze_results_adapter.py
25 26 27 | |
set_all_rankings()
Populates the list of all ranks
Source code in apps/votes_results/classes/schulze_results/schulze_results_adapter.py
57 58 59 60 61 62 63 64 65 | |
set_options()
Populates options list as string of ids
Source code in apps/votes_results/classes/schulze_results/schulze_results_adapter.py
53 54 55 | |
set_schulze_results()
Calculates all the results
Source code in apps/votes_results/classes/schulze_results/schulze_results_adapter.py
67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 | |
set_votes()
Populates the votes list
Source code in apps/votes_results/classes/schulze_results/schulze_results_adapter.py
42 43 44 45 46 47 48 49 50 51 | |