5👍
✅
The proper location for model-level validation is in the clean()
function. You can raise a django.core.exceptions.ValidationError
here to describe your error. Have a look at the documentation for clean()
Source:stackexchange.com