Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Queryset-level delete method #111

Merged
merged 6 commits into from
Sep 21, 2021

Conversation

aminalaee
Copy link
Member

Closes #10.

Add Queryset-level delete method:

await Note.objects.filter(completed=True).delete()

Or

await Note.objects.delete(completed=True)

Ideally it would return number of modified rows, it's easy to add .returning() method but at the moment supported sqlite version in python doesn't support RETURNING clauses yet (ref).

Any feedback is appreciated.

@aminalaee aminalaee merged commit 843e503 into encode:master Sep 21, 2021
@aminalaee aminalaee deleted the queryset-level-delete branch September 21, 2021 05:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Queryset-level deletes
1 participant