django-vote travis-ci python

Simple vote for django

Django Vote

django vote is a simple Django app to conduct vote for each model

Build Status

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 makemigrations vote 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)

# Adds a new vote to the object
review.votes.up(user_id)

# Removes vote to the object
review.votes.down(user_id)

# Check if the user already voted the object
review.votes.exists(user_id)

# Returns all instances voted by user
Review.votes.all(user_id)

# Returns the number of votes for the object
review.votes.count()

# Returns a list of users who voted and their voting date
review.votes.users()

Related Repositories

django-vote

django-vote

Simple vote for django ...

django-poll

django-poll

Realtime Django Poll / Vote using NodeJS, Redis, ChartJS ...


Top Contributors

shellfly tooooolong JohnnyZhao ialex jpic pushp mozillazg pivolan

Releases

-   2.1.2 zip tar
-   2.0.0rc1 zip tar
-   1.1.3 zip tar
-   1.1.1 zip tar
-   1.0.9 zip tar