From e7723683dc652613df369d5ca412e8b1217012d3 Mon Sep 17 00:00:00 2001 From: Preston Holmes Date: Sun, 30 Sep 2012 16:34:13 +0400 Subject: Fixed #9279 -- Added ignorenonexistent option to loaddata Thanks to Roman Gladkov for the initial patch and Simon Charette for review. --- docs/ref/django-admin.txt | 5 +++++ docs/releases/1.5.txt | 3 +++ docs/topics/serialization.txt | 8 ++++++++ 3 files changed, 16 insertions(+) (limited to 'docs') diff --git a/docs/ref/django-admin.txt b/docs/ref/django-admin.txt index 93e8fd9856..7fa7539985 100644 --- a/docs/ref/django-admin.txt +++ b/docs/ref/django-admin.txt @@ -289,6 +289,11 @@ Searches for and loads the contents of the named fixture into the database. The :djadminopt:`--database` option can be used to specify the database onto which the data will be loaded. +.. versionadded:: 1.5 + +The :djadminopt:`--ignorenonexistent` option can be used to ignore fields that +may have been removed from models since the fixture was originally generated. + What's a "fixture"? ~~~~~~~~~~~~~~~~~~~ diff --git a/docs/releases/1.5.txt b/docs/releases/1.5.txt index 546170b2a8..11b3488c11 100644 --- a/docs/releases/1.5.txt +++ b/docs/releases/1.5.txt @@ -195,6 +195,9 @@ Django 1.5 also includes several smaller improvements worth noting: whenever a user fails to login successfully. See :data:`~django.contrib.auth.signals.user_login_failed` +* The loaddata management command now supports an `ignorenonexistent` option to + ignore data for fields that no longer exist. + Backwards incompatible changes in 1.5 ===================================== diff --git a/docs/topics/serialization.txt b/docs/topics/serialization.txt index ac1a77ed98..9b44166e42 100644 --- a/docs/topics/serialization.txt +++ b/docs/topics/serialization.txt @@ -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 -- cgit v1.3