UPDATE
I was doing some maintenance on the server and rebooted... once it came back the code worked just fine... which actually makes me to worry ju
I have had similar case, but it worked when using construction like:
this_spot = Spot.objects.filter(pk=obj.spot.pk)
this_spot.update(friendly_rate=rating_to_be_persisted)
but not working in case, where I wanted access directly single instance, e.g from foreign key side class. Returning 'Spot' object has no attribute 'update'
.
The reason is simply the way update()
works described in django documentation:
The way around is approach like shown on the django site:
>>> b = Blog.objects.get(pk=1)
# Update all the headlines belonging to this Blog.
>>> Entry.objects.select_related().filter(blog=b).update(headline='Everything is the same')