Proposal

class policyengine.models.Proposal(*args, **kwargs)

The Proposal model represents the evaluation of a particular policy for a particular action. All data relevant to the evaluation, such as vote counts, is stored in this model.

proposal_time

Datetime object representing when the proposal was created.

status

Status of the proposal. One of PROPOSED, PASSED or FAILED.

policy

The policy that is being evaluated.

action

The action that triggered the proposal.

data

Datastore for persisting any additional data related to the proposal.

community_post

Identifier of the post that is being voted on, if any.

governance_process

The Metagov GovernanceProcess that is being used to make a decision about this Proposal, if any.

property is_vote_closed

Returns True if the vote is closed, False if the vote is still open.

get_time_elapsed()

Returns a datetime object representing the time elapsed since the first proposal.

get_all_boolean_votes(users=None)

For Boolean voting. Returns all boolean votes as a QuerySet. Can specify a subset of users to count votes of. If no subset is specified, then votes from all users will be counted.

get_yes_votes(users=None)

For Boolean voting. Returns the yes votes as a QuerySet. Can specify a subset of users to count votes of. If no subset is specified, then votes from all users will be counted.

get_no_votes(users=None)

For Boolean voting. Returns the no votes as a QuerySet. Can specify a subset of users to count votes of. If no subset is specified, then votes from all users will be counted.

get_all_number_votes(users=None)

For Number voting. Returns all number votes as a QuerySet. Can specify a subset of users to count votes of. If no subset is specified, then votes from all users will be counted.

get_one_number_votes(value, users=None)

For Number voting. Returns number votes for the specified value as a QuerySet. Can specify a subset of users to count votes of. If no subset is specified, then votes from all users will be counted.