diff options
| author | Tai Lee <tai.lee@3030.com.au> | 2012-08-01 11:49:01 +1000 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2013-10-11 12:52:57 -0400 |
| commit | e527c0b6d808cb8e4bedf79ded3dc4ad1a7e17a8 (patch) | |
| tree | 473c6c9585d87654c0ff868ec900438ec07af363 /docs/ref | |
| parent | 945e033a6964c8c83c1c5ce5f188baf41a7a7701 (diff) | |
Fixed #13252 -- Added ability to serialize with natural primary keys.
Added ``--natural-foreign`` and ``--natural-primary`` options and
deprecated the ``--natural`` option to the ``dumpdata`` management
command.
Added ``use_natural_foreign_keys`` and ``use_natural_primary_keys``
arguments and deprecated the ``use_natural_keys`` argument to
``django.core.serializers.Serializer.serialize()``.
Thanks SmileyChris for the suggestion.
Diffstat (limited to 'docs/ref')
| -rw-r--r-- | docs/ref/django-admin.txt | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/docs/ref/django-admin.txt b/docs/ref/django-admin.txt index 5bc9a2b83e..39cbbc8dd5 100644 --- a/docs/ref/django-admin.txt +++ b/docs/ref/django-admin.txt @@ -220,13 +220,34 @@ also mix application names and model names. The :djadminopt:`--database` option can be used to specify the database from which data will be dumped. +.. django-admin-option:: --natural-foreign + +.. versionadded:: 1.7 + +When this option is specified, Django will use the ``natural_key()`` model +method to serialize any foreign key and many-to-many relationship to objects of +the type that defines the method. If you are dumping ``contrib.auth`` +``Permission`` objects or ``contrib.contenttypes`` ``ContentType`` objects, you +should probably be using this flag. See the :ref:`natural keys +<topics-serialization-natural-keys>` documentation for more details on this +and the next option. + +.. django-admin-option:: --natural-primary + +.. versionadded:: 1.7 + +When this option is specified, Django will not provide the primary key in the +serialized data of this object since it can be calculated during +deserialization. + .. django-admin-option:: --natural +.. deprecated:: 1.7 + Equivalent to the :djadminopt:`--natural-foreign` option; use that instead. + Use :ref:`natural keys <topics-serialization-natural-keys>` to represent any foreign key and many-to-many relationship with a model that provides -a natural key definition. If you are dumping ``contrib.auth`` ``Permission`` -objects or ``contrib.contenttypes`` ``ContentType`` objects, you should -probably be using this flag. +a natural key definition. .. versionadded:: 1.6 |
