Skip to content
This repository was archived by the owner on May 14, 2024. It is now read-only.

Commit 47f41ce

Browse files
authored
Merge pull request #1 from waveaccounting/add-testing
Add testing and upgrade to support 1.9 - 1.11
2 parents 659e5c6 + 90bf568 commit 47f41ce

27 files changed

+457
-252
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ build/
22
dist/
33
*.pyc
44
django_ratings.egg-info/
5-
*.egg
5+
*.egg
6+
.tox/

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Change Log
2+
3+
## v 0.4.0
4+
5+
* Supports Django up to Django 1.11.
6+
* Breaking change – May not support Django 1.7 (untested). Use v 0.3.7 if necessary.

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
django-ratings
33
##############
44

5-
**This project is no longer maintained**
5+
**This project is only maintained to support existing Wave software**
66

77
A generic ratings module. The field itself appends two additional fields on the model, for optimization reasons. It adds ``<field>_score``, and ``<field>_votes`` fields, which are both integer fields.
88

circle.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
machine:
2+
environment:
3+
DATABASE_URL: mysql://ubuntu:@127.0.0.1/circle_test
4+
python:
5+
version: 2.7.6
6+
7+
dependencies:
8+
pre:
9+
- pip install -U pip tox tox-pyenv
10+
- pyenv local 2.7.11
11+
- tox --notest # Sets up the virtualenvs to be cached without running the tests.

djangoratings/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import os.path
22
import warnings
33

4-
__version__ = (0, 3, 7)
4+
__version__ = (0, 4, 0)
55

66
def _get_git_revision(path):
77
revision_file = os.path.join(path, 'refs', 'heads', 'master')

djangoratings/admin.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
from django.contrib import admin
22
from models import Vote, Score
33

4+
45
class VoteAdmin(admin.ModelAdmin):
56
list_display = ('content_object', 'user', 'ip_address', 'cookie', 'score', 'date_changed')
67
list_filter = ('score', 'content_type', 'date_changed')
78
search_fields = ('ip_address',)
89
raw_id_fields = ('user',)
910

11+
1012
class ScoreAdmin(admin.ModelAdmin):
1113
list_display = ('content_object', 'score', 'votes')
1214
list_filter = ('content_type',)

djangoratings/default_settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33
# Used to limit the number of unique IPs that can vote on a single object+field.
44
# useful if you're getting rating spam by users registering multiple accounts
5-
RATINGS_VOTES_PER_IP = 3
5+
RATINGS_VOTES_PER_IP = 3

djangoratings/exceptions.py

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
1-
class InvalidRating(ValueError): pass
2-
class AuthRequired(TypeError): pass
3-
class CannotChangeVote(Exception): pass
4-
class CannotDeleteVote(Exception): pass
5-
class IPLimitReached(Exception): pass
1+
class InvalidRating(ValueError):
2+
pass
3+
4+
5+
class AuthRequired(TypeError):
6+
pass
7+
8+
9+
class CannotChangeVote(Exception):
10+
pass
11+
12+
13+
class CannotDeleteVote(Exception):
14+
pass
15+
16+
17+
class IPLimitReached(Exception):
18+
pass

0 commit comments

Comments
 (0)