QuerySetsLesson 38Free preview
QuerySet Order By
This lesson is part of Django · All levels
Summary
Order_by() sort the QuerySet results based on one or more fields. Add a minus (-) mark before the field name to sort down. The order can be combined with the previous filter.
Key points
- Sorting up
- fields are sorting down.
- Can sort more than one field
- Can be combined with filter()
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.