As part of Django's new constraint validation, constraints now get a
violation_error_message to declare custom user-friendly error messages. Currently, UniqueConstraints with a single field can additionally have form-specific error messages set via forms'
error_messages dictionary (or in model form fields). If it's decided that check constraints also raise field errors then they will also be specifically customisable in forms.
I'd like to propose that constraints raising non-field errors to also be specifically customisable in addition to the general default set in violation_error_message – To do this validation errors would need the `code` kwarg set.