mirror of
https://github.com/django/django.git
synced 2025-08-04 10:59:45 +00:00
Merge pull request #717 from slurms/ticket_19746
Fixed #19746 -- Allow deserialization of pk-less data
This commit is contained in:
commit
4506ae0497
3 changed files with 27 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue