#35638: validate_constraints() fails on models with fields using db_default
-------------------------------------+-------------------------------------
Reporter: David Sanders | Owner: (none)
Type: Bug | Status: new
Component: Database layer | Version: dev
(models, ORM) |
Severity: Release blocker | Resolution:
Keywords: db_default | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by David Sanders):
> We should adjust _get_field_value_map to take into account db_default
(and possibly rename to _get_field_expr_map) so all constraints are
adjusted appropriately.
👍 Yup was also thinking this so good to see some confirmation there
> I suspect that other constraints as well as the unique=True and
unique_together validations that validate_unique provides are also
affected e.g.
Ah nice, I didn't think of this. Whoever picks this test up will need to
write a test for that too ☝️
I was thinking of starting a PR tomorrow if I have time, but if someone
else want to pick it up before then - you're welcome to do so.
--
Ticket URL: <https://code.djangoproject.com/ticket/35638#comment:2>
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/01070190fed19e3b-0faa6d3c-2b6a-4a8b-ab20-deec508f69ca-000000%40eu-central-1.amazonses.com.