Fixed #26256 -- Added note about primary key serialization

Thanks Sonu kumar for the report and Tim Graham for the review.
This commit is contained in:
Claude Paroz 2016-03-08 21:28:00 +01:00
parent 09e5409cb5
commit c5fda55edc
1 changed files with 2 additions and 1 deletions

View File

@ -59,7 +59,8 @@ specify a ``fields`` argument to the serializer::
data = serializers.serialize('xml', SomeModel.objects.all(), fields=('name','size')) data = serializers.serialize('xml', SomeModel.objects.all(), fields=('name','size'))
In this example, only the ``name`` and ``size`` attributes of each model will 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:: .. note::