Answer the question
In order to leave comments, you need to log in
How to set the output order of objects.all() in django?
There is a view: stepitems = Step.objects.all()
It displays 10 articles in order from the Step model. When creating articles, I typed them in order, so there was no problem with the correctness of the output. However, after I made a couple of changes to the articles, the whole output order went wrong and the articles began to be displayed in the wrong order. At the same time, all articles have a sequential ID, which for some reason is ignored.
It feels like these numbers got lost. But they cannot be corrected.
Is there a way to somehow sort the output by article id?
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