django ratings problem

67 views
Skip to first unread message

sri

unread,
Dec 24, 2012, 1:35:44 PM12/24/12
to django...@googlegroups.com

Hi, 


I am trying to add django-ratings to my app and it keeps falling over when i try to add a rating. The steps i have followed is below 

1) pip install django-ratings 

2) Add 'djangoratings' to my settings.py 

3) Add a field in my model class with field name "cust_rating = RatingField(range=5)"


Now when i try to add a rating by adding the below line, system is throwing an error.


mymodel.cust_rating.add(score=int(4), user=request.user, ip_address=request.META['REMOTE_ADDR'])


Can anyone help with what i am missing?


Thanks

Ryan Blunden

unread,
Dec 25, 2012, 1:27:14 AM12/25/12
to django...@googlegroups.com
Can you share the error and the stack trace at http://pastie.org/.

Sharing environmental information such as OS, Python version, Django version, reported django-ratings app version is also critical in helping your figure out what the issue is.

Cheers,
Ryan

sri

unread,
Dec 25, 2012, 5:54:39 AM12/25/12
to django...@googlegroups.com
Hi,

the issue has been resolved now.
The primary key for my model was a CharField and it was giving error because of that.
Once i changed my primary key to an IntergerField, it all worked fine.


Thanks
Reply all
Reply to author
Forward
0 new messages