#34338: Allow to customize the code attribute of ValidationError raised by
BaseConstraint.validate
-------------------------------------+-------------------------------------
Reporter: xafer | Owner: nobody
Type: New feature | Status: new
Component: Database layer | Version: dev
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):
* cc: Gagaro (added)
* component: Uncategorized => Database layer (models, ORM)
* stage: Unreviewed => Accepted
Comment:
Replying to [ticket:34338 xafer]:
> It is currently possible to customize the `violation_error_message` of a
`ValidationError` raised by a constraint but not the code.
>
> I'd like to add a new `violation_error_message` parameter to
BaseConstraint to allow to easily add one.
Agreed, adding `violation_error_code` sounds like a good idea as we have a
similar mechanism for validators.
--
Ticket URL: <https://code.djangoproject.com/ticket/34338#comment:1>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/010701864e234973-6a5e82e7-3fc9-41f1-9366-b41c048ec63e-000000%40eu-central-1.amazonses.com.