diff options
| author | rimi0108 <hyerimc858@gmail.com> | 2025-10-04 13:52:59 +0900 |
|---|---|---|
| committer | Jacob Walls <jacobtylerwalls@gmail.com> | 2025-12-03 15:04:52 -0500 |
| commit | 93540b34d4ef46f68df2c8bfe90447d0f649a852 (patch) | |
| tree | 93967647a5590ec653372f38cfb7123166d819c3 /docs/releases/6.1.txt | |
| parent | ddb7236b0ae9be3163c90f799fb79396e9f61cc8 (diff) | |
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 <jacobtylerwalls@gmail.com>
Diffstat (limited to 'docs/releases/6.1.txt')
| -rw-r--r-- | docs/releases/6.1.txt | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/docs/releases/6.1.txt b/docs/releases/6.1.txt index 1c533f1341..587fec10b3 100644 --- a/docs/releases/6.1.txt +++ b/docs/releases/6.1.txt @@ -281,7 +281,10 @@ Security Serialization ~~~~~~~~~~~~~ -* ... +* Subclasses of models defining the ``natural_key()`` method can now opt out of + natural key serialization by overriding the method to return an empty tuple: + ``()``. This ensures primary keys are serialized when using + :option:`dumpdata --natural-primary`. Signals ~~~~~~~ |
