Jelajahi Sumber

Fixed #26256 -- Added note about primary key serialization

Thanks Sonu kumar for the report and Tim Graham for the review.
Claude Paroz 9 tahun lalu
induk
melakukan
c5fda55edc
1 mengubah file dengan 2 tambahan dan 1 penghapusan
  1. 2 1
      docs/topics/serialization.txt

+ 2 - 1
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::