-
-
Notifications
You must be signed in to change notification settings - Fork 126
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support multi-level nested create/update with model
full_clean()
(#659
) * Add support for nested creation/update in mutations. This also has the benefit of consistently calling `full_clean()` before creating related instances. This does remove the `get_or_create()` calls and instead uses `create` only. The expectation here is that `key_attr` could and should be used to indicate what field should be used as the unique identifier, and not something hard coded that could have unintended side effects when creating related instances that don't have unique constraints and expect new instances to always be created. * Formatting * First test (heavily based on one from an existing PR) * Update new test with m2m creation/use * Add test for nested creation when creating a new resource * Add test for full_clean being called when performing nested creation or resources * Remove unecessary `@transaction.atomic()` call * Add support for nested creation of ForeignKeys
- Loading branch information
1 parent
9e6d2bb
commit 0967d04
Showing
5 changed files
with
673 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.