votes: User opinions¶
lino_xl.lib.votes plugin adds functionality for managing votes.
Table of contents:
This is a tested document. The following instructions are used for initialization:
A database object that expresses the fact that a site user has an opinion or interest about a given votable.
A database object that can receive votes.
The application developer can make the instances of a given database model votable by letting the model inherit from
Votableand specifying the model in
When adding this plugin to your application, you must specify the
- class lino_xl.lib.votes.Vote¶
Django model for representing a vote. Inherits from UserAuthored, Created, Workable
The ticket (or other votable) being voted.
The user who is voting.
The state of this vote. Pointer to
My personal priority for this ticket.
How the ticket author rates my help on this ticket.
Why I am interested in this ticket.
My nickname for this ticket. Optional.
If this is specified, then I get a quicklink to this ticket.
- class lino_xl.lib.votes.Votes¶
There are two class attributes for defining a filter conditions which cannot be removed by the user:
A set of vote states to require (i.e. to filter upon). This must resolve using
A set of vote states to exclude. This must resolve using
A set of ticket states to require (i.e. to filter upon). This must resolve using
- class lino_xl.lib.votes.AllVotes¶
Show all votes of all users.
- class lino_xl.lib.votes.MyVotes¶
Show all my votes.
- class lino_xl.lib.votes.VotesByVotable¶
Show the votes about this object.
The state of a vote¶
- class lino_xl.lib.votes.VoteState¶
The state of a vote.
Translatable text. How a vote is called when in this state.
- class lino_xl.lib.votes.VoteStates¶
The list of possible states of a vote. This is used as choicelist for the
statefield of a vote.
The default implementation defines the following choices:
Reserved for the author's vote. Lino automatically creates an author vote for every author of a ticket (see
Using votes for rating¶
- class lino_xl.lib.votes.Ratings¶
The list of available ratings.
- class lino_xl.lib.votes.VoteEvents¶
This plugin adds a welcome message "Your favourites are X, Y, ..." that
mentions all votables for which the requesting user has given
- class lino_xl.lib.votes.Votable¶
This model mixin adds two workflow actions ☆ and ★, which are mutually exclusive.
Define your vote about this object.
Button label: ☆
Visible only when you don't yet have a vote on this object. Clicking it will create a default vote object and show that object in a detail window.
Edit your vote about this object.
Button label: ★