Answer the question
In order to leave comments, you need to log in
How to work with query set in Django?
I have a problem with query set processing.
I have a similar code:
def index(request):
results = ResultInput.objects.all()
return render(request, 'main/index.html', {'title': 'Main page', 'results': results})
n = 0
ihst = []
while len(results) != n:
ihst.append((results[n].time * 100) / (results[n].f1+results[n].f2+results[n].f3)*2)
n += 1
print(ihst)
Answer the question
In order to leave comments, you need to log in
How to interact with the query set in general? As I understand it, this is not an iterable object and it will not work to access through for in.and let's start reading the docks https://docs.djangoproject.com/en/3.1/ref/models/q... so you don't write such nonsense anymore
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question