A simple Django app to conduct vote.
Project description
=====
Vote
=====
Vote is a simple Django app to conduct vote for each model
Quick start
-----------
1. Install ``django-vote`` by pip::
pip install django-vote
2. Add ``'vote'`` to your ``INSTALLED_APPS`` setting like this::
INSTALLED_APPS = (
...
'vote',
)
3. Run ``python manage.py syncdb`` to create the vote models.
4. Declare vote field to the model you want to vote::
from vote.managers import VotableManager
class ArticleReview(models.Model):
...
votes = VotableManager()
5. 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
count()
=======
Returns the number of votes for the object
users()
=======
Returns a list of users who voted and their voting date
filter()
=======
add extra info to original queryset
Vote
=====
Vote is a simple Django app to conduct vote for each model
Quick start
-----------
1. Install ``django-vote`` by pip::
pip install django-vote
2. Add ``'vote'`` to your ``INSTALLED_APPS`` setting like this::
INSTALLED_APPS = (
...
'vote',
)
3. Run ``python manage.py syncdb`` to create the vote models.
4. Declare vote field to the model you want to vote::
from vote.managers import VotableManager
class ArticleReview(models.Model):
...
votes = VotableManager()
5. 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
count()
=======
Returns the number of votes for the object
users()
=======
Returns a list of users who voted and their voting date
filter()
=======
add extra info to original queryset
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.0.8.tar.gz
(186.1 kB
view details)
File details
Details for the file django-vote-1.0.8.tar.gz
.
File metadata
- Download URL: django-vote-1.0.8.tar.gz
- Upload date:
- Size: 186.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6753b03d53a1a140e93c35229c43619c382c4e7522f23a74cbe1ace6351d3a64 |
|
MD5 | a9bd972ff0713b48ea71c3ec1445aed7 |
|
BLAKE2b-256 | 760b84692f51035d408a2bc185eb548710681c595fd9d597245bf8fb7bf98133 |