Re: [Django] #35729: Subclasses cannot opt out of natural key serialization

15 views
Skip to first unread message

Django

unread,
Sep 25, 2025, 11:46:03 AM9/25/25
to django-...@googlegroups.com
#35729: Subclasses cannot opt out of natural key serialization
--------------------------------------+------------------------------------
Reporter: Jonas Dittrich | Owner: (none)
Type: Bug | Status: new
Component: Core (Serialization) | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by Jacob Walls):

* resolution: invalid =>
* status: closed => new

--
Ticket URL: <https://code.djangoproject.com/ticket/35729#comment:4>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Sep 29, 2025, 10:36:43 AM9/29/25
to django-...@googlegroups.com
#35729: Subclasses cannot opt out of natural key serialization
--------------------------------------+------------------------------------
Reporter: Jonas Dittrich | Owner: rimchoi
Type: Bug | Status: assigned
Component: Core (Serialization) | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by rimchoi):

* owner: (none) => rimchoi
* status: new => assigned

--
Ticket URL: <https://code.djangoproject.com/ticket/35729#comment:5>

Django

unread,
Oct 4, 2025, 4:19:00 AM10/4/25
to django-...@googlegroups.com
#35729: Subclasses cannot opt out of natural key serialization
--------------------------------------+------------------------------------
Reporter: Jonas Dittrich | Owner: rimchoi
Type: Bug | Status: assigned
Component: Core (Serialization) | Version: dev
Severity: Normal | 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 rimchoi):

* has_patch: 0 => 1

--
Ticket URL: <https://code.djangoproject.com/ticket/35729#comment:6>

Django

unread,
Oct 17, 2025, 4:20:31 PM10/17/25
to django-...@googlegroups.com
#35729: Subclasses cannot opt out of natural key serialization
--------------------------------------+------------------------------------
Reporter: Jonas Dittrich | Owner: rimchoi
Type: Bug | Status: assigned
Component: Core (Serialization) | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by Jacob Walls):

* needs_better_patch: 0 => 1

Comment:

Great start here. Left a few comments to help advance this.
--
Ticket URL: <https://code.djangoproject.com/ticket/35729#comment:7>

Django

unread,
Dec 2, 2025, 3:14:44 PM12/2/25
to django-...@googlegroups.com
#35729: Subclasses cannot opt out of natural key serialization
-------------------------------------+-------------------------------------
Reporter: Jonas Dittrich | Owner: rimchoi
Type: Bug | Status: assigned
Component: Core | Version: dev
(Serialization) |
Severity: Normal | 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 Jacob Walls):

* needs_better_patch: 1 => 0
* stage: Accepted => Ready for checkin

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

Django

unread,
Dec 3, 2025, 3:05:02 PM12/3/25
to django-...@googlegroups.com
#35729: Subclasses cannot opt out of natural key serialization
-------------------------------------+-------------------------------------
Reporter: Jonas Dittrich | Owner: rimchoi
Type: Bug | Status: closed
Component: Core | Version: dev
(Serialization) |
Severity: Normal | 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 Jacob Walls <jacobtylerwalls@…>):

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

Comment:

In [changeset:"93540b34d4ef46f68df2c8bfe90447d0f649a852" 93540b34]:
{{{#!CommitTicketReference repository=""
revision="93540b34d4ef46f68df2c8bfe90447d0f649a852"
Fixed #35729 -- Enabled natural key serialization opt-out for subclasses.

Refactored serialization logic to allow models inheriting a natural_key()
method (e.g. AbstractBaseUser) to explicitly opt out of natural key
serialization by returning an empty tuple from the method.

Thanks Jonas Dittrich for the report.

Co-authored-by: Jacob Walls <jacobty...@gmail.com>
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/35729#comment:9>
Reply all
Reply to author
Forward
0 new messages