I have a model:
class MyModel(models.Model):
fieldA = models.IntegerField()
fieldB = models.IntegerField()
fieldC = models.IntegerField()
Now, let's get a QuerySet, e.g.
qs = MyModel.objects.all()
I'd like to be able to change fieldB
and fieldC
of all instances in qs
with the same value and save them as NEW records in my database. I need something similar to qs.update(fieldB=2, fieldC=3)
but I don't want to override the original records in qs
. Is there a Django-way to do so (i.e., something not involving a manually coded for
loop)?