[Answer]-Loop through objects and change their values

1👍

Instead of for loop, use queryset.update with django.db.models.F:

from django.db.models import F

...

StoreLiquor.objects.filter(storeID=storeID, SPI__gt=LiqSPI).update(SPI=F('SPI')-1)

Leave a comment