#26256: JSON serializer for subset of fields.
--------------------------------------+------------------------------------
Reporter: sonus21 | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Documentation | Version: 1.8
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by claudep):
* has_patch: 0 => 1
Comment:
A suggestion:
{{{#!diff
diff --git a/docs/topics/serialization.txt b/docs/topics/serialization.txt
index 6132c63..c46dbe5 100644
--- a/docs/topics/serialization.txt
+++ b/docs/topics/serialization.txt
@@ -59,7 +59,8 @@ specify a ``fields`` argument to the serializer::
data = serializers.serialize('xml', SomeModel.objects.all(),
fields=('name','size'))
In this example, only the ``name`` and ``size`` attributes of each model
will
-be serialized.
+be serialized. The primary key is always serialized as the ``pk`` element
in the
+resulting output, it never appears in the ``fields`` part.
.. note::
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/26256#comment:5>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/065.d0b22b484aa2af676705f29d2b5c78ea%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.