#36062: Deserializing CompositePrimaryKey from a string raises raises ValueError
-------------------------------------+-------------------------------------
Reporter: Jacob Walls | Owner: Sarah
| Boyce
Type: Bug | Status: assigned
Component: Core | Version: dev
(Serialization) |
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Simon Charette):
As pointed out on the PR we likely need to implement the proper
`value_to_string`, `value_from_object`, and `to_python` methods for
`CompositePrimaryKey` ([
https://docs.djangoproject.com/en/5.1/howto
/custom-model-fields/#converting-model-field-to-serialization docs]) and
ensure the serialization framework calls `value_to_string` instead of
making direct `str` calls.
See how it's done for `JSONField`, `postgres.ArrayField`, and
`HStoreField` for example.
--
Ticket URL: <
https://code.djangoproject.com/ticket/36062#comment:6>
Django <
https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.