diff options
Diffstat (limited to 'docs/topics')
| -rw-r--r-- | docs/topics/serialization.txt | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/docs/topics/serialization.txt b/docs/topics/serialization.txt index 2b28f5e15a..f801df0561 100644 --- a/docs/topics/serialization.txt +++ b/docs/topics/serialization.txt @@ -638,6 +638,15 @@ command line flags to generate natural keys. natural keys during serialization, but *not* be able to load those key values, just don't define the ``get_by_natural_key()`` method. +Subclasses can opt out of natural key serialization by returning an empty tuple +(``()``) from ``natural_key()``. This tells the serializer to fall back to +the standard primary key. + +.. versionchanged:: 6.1 + + Support for opting out of natural key serialization by returning an empty + tuple was added. + .. _natural-keys-and-forward-references: Natural keys and forward references |
