Django 6 · ORM queries

Update many rows

Update all matching rows with one query.

Post.objects.filter(published=False).update(published=True)

Official Django 6 documentation

More orm queries commands

All orm queries commands · Django 6 cheatsheet

Was this page helpful?