Fixed #9279 -- Added ignorenonexistent option to loaddata

Thanks to Roman Gladkov for the initial patch and Simon Charette for review.
This commit is contained in:
Preston Holmes 2012-09-30 16:34:13 +04:00
parent 7cc4068c44
commit e7723683dc
7 changed files with 76 additions and 2 deletions

View file

@ -130,6 +130,14 @@ trust your data source you could just save the object and move on.
The Django object itself can be inspected as ``deserialized_object.object``.
.. versionadded:: 1.5
If fields in the serialized data do not exist on a model,
a ``DeserializationError`` will be raised unless the ``ignorenonexistent``
argument is passed in as True::
serializers.deserialize("xml", data, ignorenonexistent=True)
.. _serialization-formats:
Serialization formats