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

update-or-create method #113

Merged
merged 3 commits into from
Sep 27, 2021
Merged

Conversation

aminalaee
Copy link
Member

@aminalaee aminalaee commented Sep 23, 2021

Adds an update_or_create method the same way Django does:

note, created = await Note.objects.update_or_create(text="EXample", defaults={"completed": True})

Closes #54

@aminalaee aminalaee merged commit aba7907 into encode:master Sep 27, 2021
@aminalaee aminalaee deleted the update-or-create-method branch September 27, 2021 06:31
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.

Add QuerySet-level convenience method: update_or_create
1 participant