I tried using the example that they gave on the documentation of this app.
Their example:
And adding votes is also simple:
Ubicacion.rating.add(score=1, user=request.user, ip_address=request.META['REMOTE_ADDR'])
but it returns me this error:
'RatingField' object has no attribute 'add'
And I did look up in the fields.py of the app, and indeed there is a function "add"
So I don't know why when I create the object of that class doesn't recognize the attributes of that class?
This is my model:
class Ubicacion(models.Model):
route = models.LineStringField()
coordsdet = models.LineStringField()
fecha = models.DateTimeField(auto_now_add=True)
user = models.ForeignKey(User)
objects = models.GeoManager()
rating = RatingField(range=5)