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
Source:stackexchange.com