A simple Django app to conduct vote.
Project description
Vote is a simple Django app to conduct vote for each model
Quick start
Install django-vote by pip:
pip install django-vote
Add 'vote' to your INSTALLED_APPS setting like this:
INSTALLED_APPS = ( ... 'vote', )
Run python manage.py syncdb to create the vote models.
Declare vote field to the model you want to vote:
from vote.managers import VotableManager class ArticleReview(models.Model): ... votes = VotableManager()
Use vote API:
>>> review = ArticleReview.objects.get(pk=1) >>> review.votes.up(user) >>> review.votes.down(user)
API
up(user)
Adds a new vote to the object
down(user)
Removes vote to the object
exists(user)
Check if the user already voted the object
all(user)
return all instances voted by user
count()
Returns the number of votes for the object
users()
Returns a list of users who voted and their voting date
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
django-vote-1.1.2.tar.gz
(186.2 kB
view details)
File details
Details for the file django-vote-1.1.2.tar.gz
.
File metadata
- Download URL: django-vote-1.1.2.tar.gz
- Upload date:
- Size: 186.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e56e96ca64d9b1d9f5edc21c3942a5133f980831ebb1634b056f375a96d8918d |
|
MD5 | 6b31fc681b67713bf8784b5be4f8ad20 |
|
BLAKE2b-256 | 59e8a4fce6a744b57e8a26f65de601b402520cd645b7951a0a5070c3e7a1f2c5 |