[Answer]-Django-ratings : 'RatingField' object has no attribute 'add'

1👍

Not familiar with django-ratings, but it looks like you should be calling the rating.add on an instance of your Ubicacion class- not on the class itself.

First create an instance:

myinstance = Ubicacion.objects.create(...)

Then, according to the django-ratings docs you could call add:

myinstance.rating.add(score=1, user=request.user, ip_address=request.META['REMOTE_ADDR'])
👤dgel

Leave a comment