0

I get an AttributeError: 'QuerySet' object has no attribute 'ratings' when trying to do something like this in my view:

def index(request): thing_list = Thing.ratings.cumulative_score() return render(request, 'index.html', {'thing_list':thing_list}) 

My model:

from ratings.models import Ratings class Thing(models.Model): user = models.ForeignKey(User) ... rating = Ratings() 

While using django-simple-ratings app. This link references where cumulative_score is defined in that module. How do I use cumulative score? Thank you for your ideas!

1
  • Post the full traceback somewhere (pastebin, ...)? Commented Jan 8, 2013 at 9:21

1 Answer 1

2

You've referenced ratings in your view, but defined the manager attribute as rating (no 's').

Sign up to request clarification or add additional context in comments.

1 Comment

Thank you for your answer! Unfortunately, solving this error has resulted in another, which I referenced here if you have any further ideas. Thanks for your input.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.