I have a 5 column model with around 10,000+ lines of data. Now I want to update one column of all the lines based on other column values.
>Solution :
myModel = MyModel.objects.all()
for l in myModel:
if c1=='ChkVal1' and c2 < c3:
c4='Value 1'
elif c1=='ChkVal2' and c2 b> c3:
c4='Value 2'
else
c4='Value 3'
MyModel.objects.bulk_update(myModel, update_fields = ['c4'])