Answer the question
In order to leave comments, you need to log in
Do transactions work in a loop in Django?
There is a function processing the request. The application structure requires that writing to the database is carried out in a loop in a separate function:
def responseFunction(request):
for el in request.POST['elements']:
#...
saveToDb(el)
def saveToDb(el):
#...
enrty.save()
return HttpResponse()
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question