Re: [Django] #36062: Deserializing CompositePrimaryKey from a string raises raises ValueError

8 views
Skip to first unread message

Django

unread,
Jan 6, 2025, 1:35:35 PM1/6/25
to django-...@googlegroups.com
#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.

Django

unread,
Jan 7, 2025, 3:11:40 AM1/7/25
to django-...@googlegroups.com
#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: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Sarah Boyce):

* needs_better_patch: 1 => 0

--
Ticket URL: <https://code.djangoproject.com/ticket/36062#comment:7>

Django

unread,
Jan 8, 2025, 8:44:49 AM1/8/25
to django-...@googlegroups.com
#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: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Sarah Boyce):

* stage: Accepted => Ready for checkin

--
Ticket URL: <https://code.djangoproject.com/ticket/36062#comment:8>

Django

unread,
Jan 8, 2025, 8:53:08 AM1/8/25
to django-...@googlegroups.com
#36062: Deserializing CompositePrimaryKey from a string raises raises ValueError
-------------------------------------+-------------------------------------
Reporter: Jacob Walls | Owner: Sarah
| Boyce
Type: Bug | Status: closed
Component: Core | Version: dev
(Serialization) |
Severity: Release blocker | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Sarah Boyce <42296566+sarahboyce@…>):

* resolution: => fixed
* status: assigned => closed

Comment:

In [changeset:"6a1a9c0eade674780060cf8af5f5b3375156cdd5" 6a1a9c0]:
{{{#!CommitTicketReference repository=""
revision="6a1a9c0eade674780060cf8af5f5b3375156cdd5"
Fixed #36062 -- Handled serialization of CompositePrimaryKeys.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/36062#comment:9>
Reply all
Reply to author
Forward
0 new messages