From 2d0ae995d6b2fb58853fc59802ad781ba03376a6 Mon Sep 17 00:00:00 2001 From: Helen Sherwood-Taylor Date: Wed, 24 Dec 2014 19:15:48 +0000 Subject: [1.6.x] Fixed #24041 -- Documented effect of changing a model instance's primary key. Backport of 4ccdf6e57f49d7e981dcd88c1db65229b8b92487 from master --- docs/ref/models/fields.txt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'docs/ref') diff --git a/docs/ref/models/fields.txt b/docs/ref/models/fields.txt index 5c11412e33..6f63884d01 100644 --- a/docs/ref/models/fields.txt +++ b/docs/ref/models/fields.txt @@ -258,8 +258,13 @@ don't need to set ``primary_key=True`` on any of your fields unless you want to override the default primary-key behavior. For more, see :ref:`automatic-primary-key-fields`. -``primary_key=True`` implies :attr:`null=False ` and :attr:`unique=True `. -Only one primary key is allowed on an object. +``primary_key=True`` implies :attr:`null=False ` and +:attr:`unique=True `. Only one primary key is allowed on an +object. + +The primary key field is read-only. If you change the value of the primary +key on an existing object and then save it, a new object will be created +alongside the old one. ``unique`` ---------- -- cgit v1.3