-
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.
Call full_clean() in save(), so we don't need django-fullclean (#128)
At least, for Binder models this is the case. All models managed by Binder views should inherit from BinderModel, and if not, the user should code validation error checking in _store(). In all our projects we use django-fullclean because being able to accidentally save invalid models is a huge mind fuck. Thus, it is pointless to call full_clean() in our views, as it means we'll be running potentially expensive validations twice. For example, relation fields check that the foreign relation exists, which requires a query per relation field. It is technically a breaking change, but for most projects this will be a non-issue. The test suite of Boekestijn passed except for one test which was specifically for its User view, which uses a non-Binder model. This was relatively easy to convert to use a full_clean() in its _store() method.
- Loading branch information
Peter Bex
committed
Aug 31, 2020
1 parent
06aff1a
commit 339db1d
Showing
15 changed files
with
96 additions
and
175 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
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
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.