Merge pull request #717 from slurms/ticket_19746

Fixed #19746 -- Allow deserialization of pk-less data
This commit is contained in:
Florian Apolloner 2013-02-24 06:31:14 -08:00
commit 4506ae0497
3 changed files with 27 additions and 3 deletions

View file

@ -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