Consistent checks at every level

I’d like to use fields with consistent checking at every level. I’m thinking HTML5 min, max, pattern attributes for the user interface, Validators at the Python level, and constraints on the database. Does a library like this exist? If not, does anyone advise a different approach or have a similar need or want to help make it? My specific usage is at https://github.com/biobuddies/wellplat](Refactor checked fields by covracer · Pull Request #4 · biobuddies/wellplated · GitHub

One idea I’ve heard proposed before that I’d be interested in feedback on: will calling full_clean() from save() break things?

I think it’s less a case that it would break something, and more a situation that it’s not going to cover everything you think it’s going to cover. There are a number of ORM API functions that bypass Model.save(), and so if you’re relying upon that feature to ensure the data is clean, there will be cases where it’s possible that the data isn’t.

Also, when forms are involved, you’ll likely be running that function twice - the form will call it, and then you’ll be calling it again in the save.

So while this might look like a great idea, there are reasons why Django doesn’t do this by default.