Skip to content Skip to sidebar Skip to footer

F() Expressions In Django Keeps Giving Me 0

I am about to update approx 2-3k of records for one of my django model. I know that using the update() would help but then because I am actually using the same value in the field a

Solution 1:

Does this work?

querysets = Model.objects.filter(id__in[111, 123])
querysets.name = F('name') + ' testing'
querysets.save()

Post a Comment for "F() Expressions In Django Keeps Giving Me 0"