Django 6 · ORM queries

Filter and sort

Get published posts, newest first.

Post.objects.filter(published=True).order_by("-created")

Official Django 6 documentation

More orm queries commands

All orm queries commands · Django 6 cheatsheet

Was this page helpful?