A django app that adds upvote and downvote to your models
Add VoteMixin to your models.
from django.contrib.auth.models import User
from django.db import models
from django_und.models import VoteMixin
class Article(VoteMixin, models.Model):
title = models.CharField('title', max_length=200)
content = models.TextField('content')
Upvote and downvote :
article = Article(title="Test Article", content="Lorem Ipsum")
article.upvote(user) # user is a instance of settings.AUTH_USER_MODEL
article.und_score # 1
article.und_score_up # 1
article.und_score_down # 0
article.downvote(user)
See tests to see exhaustive usage examples.
Django up & down is available under the terms of LGPL-v3 license