Skip to content

Implement update_or_create method#337

Merged
ellmetha merged 4 commits intomainfrom
update-or-create
Feb 20, 2026
Merged

Implement update_or_create method#337
ellmetha merged 4 commits intomainfrom
update-or-create

Conversation

@treagod
Copy link
Contributor

@treagod treagod commented Feb 2, 2026

This commit adds a new #update_or_create method to the querysets.

With this newly added method a developer can update specific fields, defined by updates, of record that matches the filter or, if no record can be found, create a new record. The new record will either created by the updates arguments or a custom defaults hash can be used if creation requires certain fields to be set

Closes #308

@treagod treagod marked this pull request as draft February 2, 2026 11:51
@treagod treagod marked this pull request as ready for review February 5, 2026 12:43
@treagod treagod requested a review from ellmetha February 6, 2026 17:24
@treagod treagod requested a review from ellmetha February 18, 2026 07:06
Copy link
Member

@ellmetha ellmetha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Thanks for adding this!

@ellmetha ellmetha merged commit 9630684 into main Feb 20, 2026
72 checks passed
@ellmetha ellmetha deleted the update-or-create branch February 20, 2026 15:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Add an #update_or_create method to query sets

2 participants