Welcome to the Treehouse Community
Looking to learn something new?
Anusha RaoCourses Plus Student 972 Points
Double the rating field using F .
I don't know where am I going wrong here!
from django.db.models import F from .models import Review def double_ratings(): reviews = Review.objects.all() reviews.update(rating = F('rating') * 2) reviews.save()
Idai Yaffe20,429 Points
You do not need to save the objects after an update so the 'reviews' variable is unnecessary.
def double_ratings(): Review.objects.update(rating=F('rating')*2)
I think your code will work and the challenge doesn't like it but I'm not sure