summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorNick Sandford <nick@sandford.id.au>2013-02-12 14:00:38 +0800
committerNick Sandford <nick@sandford.id.au>2013-02-12 17:10:42 +0800
commit278dad5b411e3e2ba8b428f7761882424353dea7 (patch)
tree41ffd0ec7d56c90d19ff703320b0cbaf7fc97cbc /docs
parent5a3d9490f14263cc4ed78b6adcb764936b07b4ae (diff)
Fixed #19746 -- Allow deserialization of pk-less data
Diffstat (limited to 'docs')
-rw-r--r--docs/topics/serialization.txt10
1 files changed, 10 insertions, 0 deletions
diff --git a/docs/topics/serialization.txt b/docs/topics/serialization.txt
index 2af0584a61..982f986aad 100644
--- a/docs/topics/serialization.txt
+++ b/docs/topics/serialization.txt
@@ -117,6 +117,16 @@ object and any associated relationship data.
Calling ``DeserializedObject.save()`` saves the object to the database.
+.. note::
+
+ If the ``pk`` attribute in the serialized data doesn't exist or is
+ null, a new instance will be saved to the database.
+
+.. versionchanged:: 1.6
+
+In previous versions of Django, the ``pk`` attribute had to be present
+on the serialized data or a ``DeserializationError`` would be raised.
+
This ensures that deserializing is a non-destructive operation even if the
data in your serialized representation doesn't match what's currently in the
database. Usually, working with these ``DeserializedObject`` instances looks