# HG changeset patch # User Ahsan Ali Shahid # Date 1374255625 -18000 # Node ID c13a3ab314ab631453b96be7f4913397a1acbea7 # Parent 2619e53b1ec2b1e183d3b1190c9944a2d1a7b3bd Added RatingField import and fixed an html tag in snippet template diff -r 2619e53b1ec2 -r c13a3ab314ab apps/snippet/models.py --- a/apps/snippet/models.py Fri Jul 19 22:13:14 2013 +0500 +++ b/apps/snippet/models.py Fri Jul 19 22:40:25 2013 +0500 @@ -8,7 +8,7 @@ from mptt.models import MPTTModel, TreeForeignKey from apps.snippet.highlight import LEXER_DEFAULT, LEXER_LIST, pygmentize - +from djangoratings.fields import RatingField t = 'abcdefghijkmnopqrstuvwwxyzABCDEFGHIJKLOMNOPQRSTUVWXYZ1234567890' def generate_secret_id(length=4): diff -r 2619e53b1ec2 -r c13a3ab314ab templates/snippet/snippet_details.djhtml --- a/templates/snippet/snippet_details.djhtml Fri Jul 19 22:13:14 2013 +0500 +++ b/templates/snippet/snippet_details.djhtml Fri Jul 19 22:40:25 2013 +0500 @@ -74,9 +74,11 @@ Language: {{ language }} — Number of views: {{ snippet.num_views }} + {% load ratings %} Total Votes: {{ snippet.rating.votes }} Rating: {{ score }} +