From c5fda55edc13118c344cbf6e862a3a6a038e5578 Mon Sep 17 00:00:00 2001 From: Claude Paroz Date: Tue, 8 Mar 2016 21:28:00 +0100 Subject: [PATCH] Fixed #26256 -- Added note about primary key serialization Thanks Sonu kumar for the report and Tim Graham for the review. --- docs/topics/serialization.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/topics/serialization.txt b/docs/topics/serialization.txt index 6132c639bf..ea0e74fe47 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::