-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid validating foreign key checks if the key never changed
This leverages our custom full_clean implementation (#141) in combination with the LoadedValues mixin. This allows us to know when a value did not change and avoid validating the foreign key just before save, because the foreign key was fine as it was stored, so it cannot suddenly become invalid. For complex models with many relations or which are saved a lot, this makes a big difference, as the reduced number of queries can make things quite a bit more efficient.
- Loading branch information
Peter Bex
committed
Sep 1, 2020
1 parent
b5ec096
commit dd489f6
Showing
2 changed files
with
15 additions
and
6 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