#35575: Add support for constraint validation on GeneratedFields
-------------------------------------+-------------------------------------
Reporter: Mark Gensler | Owner: Mark
| Gensler
Type: New feature | Status: assigned
Component: Database layer | Version: 5.0
(models, ORM) |
Severity: Normal | Resolution:
Keywords: generatedfield | Triage Stage: Accepted
uniqueconstraint checkconstraint |
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Simon Charette):
The patch looks ready to be reviewed to me. I requested that a release
note be added for 5.0.X just in case we wanted to backport but in the
light of #35560 disabling validation at first I think we should just
consider this a new feature for inclusion in 5.2.x. That would also gives
us enough time to properly address #34871 by then without restricting
ourselves to solutions that are not to invasive for a backport. Given any
of the `GeneratedField` validation can be emulated with expression
constraints as Mark pointed out it should allow for users to lean into
that in the mean time.
IMO the branch demonstrates that enabling this feature is achievable
without too much boilerplate an ensures that `GeneratedField` works just
like any other `Field` with regards to `Meta.constraints` instead of
crashing with `IntegrityError`.
--
Ticket URL: <https://code.djangoproject.com/ticket/35575#comment:13>
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/01070190db99aa4c-fe197086-79df-463f-a5ff-397e72c2b68b-000000%40eu-central-1.amazonses.com.