l.r.b.p.BasePollView(LaunchpadView) : class documentation

Part of lp.registry.browser.poll View In Hierarchy

Known subclasses: lp.registry.browser.poll.PollView, lp.registry.browser.poll.PollVoteView

A base view class to be used in other poll views.
Method setUpTokenAndVotes Set up the token and votes to be displayed.
Method setUpTokenAndVotesForNonSecretPolls Get the votes of the logged in user in this poll.
Method setUpTokenAndVotesForSecretPolls Get the votes with the token provided in the form.
Method userCanVote Return True if the user is/was eligible to vote on this poll.
Method userVoted Return True if the user voted on this poll.
Method isCondorcet Return True if this poll's type is Condorcet.
Method isSimple Return True if this poll's type is Simple.
Method isSecret Return True if this is a secret poll.
def setUpTokenAndVotes(self):
Set up the token and votes to be displayed.
def setUpTokenAndVotesForNonSecretPolls(self):
Get the votes of the logged in user in this poll.

Set the votes in instance variables and also set self.gotTokenAndVotes to True, so the templates know they can display the vote.

This method should be used only on non-secret polls and if the logged in user has voted on this poll.

def setUpTokenAndVotesForSecretPolls(self):
Get the votes with the token provided in the form.

Set the votes, together with the token in instance variables. Also set self.gotTokenAndVotes to True, so the templates know they can display the vote.

Return True if there's any vote with the given token and the votes are on this poll.

This method should be used only on secret polls and if the logged in user has voted on this poll.

def userCanVote(self):
Return True if the user is/was eligible to vote on this poll.
def userVoted(self):
Return True if the user voted on this poll.
def isCondorcet(self):
Return True if this poll's type is Condorcet.
def isSimple(self):
Return True if this poll's type is Simple.
def isSecret(self):
Return True if this is a secret poll.
API Documentation for Launchpad, generated by pydoctor at 2022-06-16 00:00:12.