summaryrefslogtreecommitdiff
path: root/docs/serialization.txt
diff options
context:
space:
mode:
authorJustin Bronn <jbronn@gmail.com>2008-08-05 17:15:33 +0000
committerJustin Bronn <jbronn@gmail.com>2008-08-05 17:15:33 +0000
commitaa239e3e5405933af6a29dac3cf587b59a099927 (patch)
treeea2cbd139c9a8cf84c09e0b2008bff70e05927ef /docs/serialization.txt
parent45b73c9a4685809236f84046cc7ffd32a50db958 (diff)
gis: Merged revisions 7981-8001,8003-8011,8013-8033,8035-8036,8038-8039,8041-8063,8065-8076,8078-8139,8141-8154,8156-8214 via svnmerge from trunk.archive/attic/gis
git-svn-id: http://code.djangoproject.com/svn/django/branches/gis@8215 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs/serialization.txt')
-rw-r--r--docs/serialization.txt24
1 files changed, 9 insertions, 15 deletions
diff --git a/docs/serialization.txt b/docs/serialization.txt
index 2a3e7038da..971103747c 100644
--- a/docs/serialization.txt
+++ b/docs/serialization.txt
@@ -2,13 +2,6 @@
Serializing Django objects
==========================
-.. note::
-
- This API is currently under heavy development and may change --
- perhaps drastically -- in the future.
-
- You have been warned.
-
Django's serialization framework provides a mechanism for "translating" Django
objects into other formats. Usually these other formats will be text-based and
used for sending Django objects over a wire, but it's possible for a
@@ -58,10 +51,10 @@ be serialized.
.. note::
- Depending on your model, you may find that it is not possible to deserialize
- a model that only serializes a subset of its fields. If a serialized object
- doesn't specify all the fields that are required by a model, the deserializer
- will not be able to save deserialized instances.
+ Depending on your model, you may find that it is not possible to
+ deserialize a model that only serializes a subset of its fields. If a
+ serialized object doesn't specify all the fields that are required by a
+ model, the deserializer will not be able to save deserialized instances.
Inherited Models
~~~~~~~~~~~~~~~~
@@ -75,13 +68,13 @@ However, if you have a model that uses `multi-table inheritance`_, you also
need to serialize all of the base classes for the model. This is because only
the fields that are locally defined on the model will be serialized. For
example, consider the following models::
-
+
class Place(models.Model):
name = models.CharField(max_length=50)
-
+
class Restaurant(Place):
serves_hot_dogs = models.BooleanField()
-
+
If you only serialize the Restaurant model::
data = serializers.serialize('xml', Restaurant.objects.all())
@@ -126,7 +119,8 @@ something like::
deserialized_object.save()
In other words, the usual use is to examine the deserialized objects to make
-sure that they are "appropriate" for saving before doing so. Of course, if you trust your data source you could just save the object and move on.
+sure that they are "appropriate" for saving before doing so. Of course, if you
+trust your data source you could just save the object and move on.
The Django object itself can be inspected as ``deserialized_object.object``.