#19299: Foreign keys using to_field and having legitimate empty string values
fail
with NULL errors
----------------------------------------------+--------------------
Reporter: evan@… | Owner: nobody
Type: Bug | Status: new
Component: Database layer (models, ORM) | Version: 1.4
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 1
Easy pickings: 0 | UI/UX: 0
----------------------------------------------+--------------------
If one table references another table with a foreign
key using a to_field that's a string, and the target column has an empty
string as a possible value, the ORM would remap it to None, and thus
NULL, which is not the same, and which breaks the relation.
[https://github.com/tunixman/django/commit/45f1da6aea8921c55dfc2f5618d03c800d3fa803
Minimal test case and fix]
--
Ticket URL: <https://code.djangoproject.com/ticket/19299>
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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit https://groups.google.com/groups/opt_out.