Using django-ratings; need help

32 views
Skip to first unread message

DF

unread,
Jul 2, 2012, 9:50:22 PM7/2/12
to django...@googlegroups.com
I've been trying for two weeks to implement the highly regarded django-ratings with zero success.

I've followed all directions, which are not that detailed, and cannot figure out how to actually present a means for a user to submit a rating with the template.

There are no directions on how to load template tags associated with it, so it resulted in errore. After looking through the code, it appears "ratings" was the proper way to load the tags within the template, so I employed that.

I added 'djangoratings' to settings.py.

The following to my model:

    rating = RatingField(range=5)

I also did the following to urls.py:

from djangoratings.views import AddRatingFromModel

    url(r'rate-my-post/(?P<object_id>\d*)/(?P<score>\d*)/', AddRatingFromModel(), {
        'app_label': 'report',
        'model': 'story',
        'field_name': 'rating',
    }),

Added this to the template:

{% rating_by_user user on story.rating as vote %}

And nothing appears. No means for the user to vote. Nothing.

I cannot figure out what may be wrong here and after two weeks of tweaking and trying different methods, nothing works.

If anyone has an idea of what is required to present some interface for a user to vote using this app, I would be extremely grateful.




Sapa S

unread,
Jul 6, 2014, 10:36:57 PM7/6/14
to django...@googlegroups.com
Were you able to get it to work?  I want to use a rating app and django-ratings seems to be the most actively used.  And similar to you, I don't know how to write the template.  If you were able to get it working, could you share your experience?  Thanks.
Reply all
Reply to author
Forward
0 new messages