diff options
author | Arthur Koziel <arthur@arthurkoziel.com> | 2010-09-13 00:04:27 +0000 |
---|---|---|
committer | Arthur Koziel <arthur@arthurkoziel.com> | 2010-09-13 00:04:27 +0000 |
commit | dd49269c7db008b2567f50cb03c4d3d9b321daa1 (patch) | |
tree | 326dd25bb045ac016cda7966b43cbdfe1f67d699 /docs/topics/serialization.txt | |
parent | c9b188c4ec939abbe48dae5a371276742e64b6b8 (diff) | |
download | django-soc2010/app-loading.tar.gz |
[soc2010/app-loading] merged trunkarchive/soc2010/app-loadingsoc2010/app-loading
git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2010/app-loading@13818 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs/topics/serialization.txt')
-rw-r--r-- | docs/topics/serialization.txt | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/docs/topics/serialization.txt b/docs/topics/serialization.txt index 1cf8e86462..c8acc8539e 100644 --- a/docs/topics/serialization.txt +++ b/docs/topics/serialization.txt @@ -1,5 +1,3 @@ -.. _topics-serialization: - ========================== Serializing Django objects ========================== @@ -141,10 +139,6 @@ to install third-party Python modules: ``json`` Serializes to and from JSON_ (using a version of simplejson_ bundled with Django). - ``python`` Translates to and from "simple" Python objects (lists, dicts, - strings, etc.). Not really all that useful on its own, but - used as a base for other serializers. - ``yaml`` Serializes to YAML (YAML Ain't a Markup Language). This serializer is only available if PyYAML_ is installed. ========== ============================================================== @@ -169,7 +163,7 @@ For example:: json_serializer.serialize(queryset, ensure_ascii=False, stream=response) The Django source code includes the simplejson_ module. However, if you're -using Python 2.6 (which includes a builtin version of the module), Django will +using Python 2.6 or later (which includes a builtin version of the module), Django will use the builtin ``json`` module automatically. If you have a system installed version that includes the C-based speedup extension, or your system version is more recent than the version shipped with Django (currently, 2.0.7), the @@ -338,7 +332,7 @@ example, ``(first name, last name)``. Then, when you call ``serializers.serialize()``, you provide a ``use_natural_keys=True`` argument:: - >>> serializers.serialize([book1, book2], format='json', indent=2, use_natural_keys=True) + >>> serializers.serialize('json', [book1, book2], indent=2, use_natural_keys=True) When ``use_natural_keys=True`` is specified, Django will use the ``natural_key()`` method to serialize any reference to objects of the |