İlkem Çetinkaya
İlkem Çetinkaya

Reputation: 214

django update usage within for loop

Within Django, I can't update the database even though all is correct.(I assume :) )

Here is the prints for the groups.items:

397 350 try_3
397 450 try_4
370 350 try_1
370 450 try_2

Upvotes: 1

Views: 107

Answers (1)

Sina Khelil
Sina Khelil

Reputation: 1991

you should try qs = RFP.objects.filter(id=thing_id) instead of qs = RFP.objects.filter(id__in=thing_id). the __in is looking for list of ids and you are providing a string and it will treat the string as a list instead.

Upvotes: 1

Related Questions