Skip to content
This repository was archived by the owner on Aug 19, 2025. It is now read-only.

queryset-level update method#112

Merged
aminalaee merged 1 commit intoencode:masterfrom
aminalaee:queryset-level-update-method
Sep 22, 2021
Merged

queryset-level update method#112
aminalaee merged 1 commit intoencode:masterfrom
aminalaee:queryset-level-update-method

Conversation

@aminalaee
Copy link
Contributor

Closes #9

You can update instances by calling .update() on a queryset:

await Note.objects.filter(completed=True).update(completed=False)

It's not very common, but to update all rows in a table:

await Note.objects.update(completed=False)

@aminalaee aminalaee merged commit dc93180 into encode:master Sep 22, 2021
@aminalaee aminalaee deleted the queryset-level-update-method branch September 22, 2021 05:04
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Queryset-level updates

1 participant