﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
37468	Clarify the effects of changing primary keys in models and ModelForms	Sarah Boyce	Sarah Boyce	"The primary key documentation explains that changing an existing instance’s primary key and saving it creates a new object alongside the original. See https://docs.djangoproject.com/en/dev/topics/db/models/#field-options

However, it does not explain that if an object with the new primary key already exists, saving the instance updates that object instead. 

This behavior also applies to a `ModelForm` bound to an existing instance when an editable primary key field is included in the form. Changing that field can cause the form to update a different object from the one originally supplied through `instance`.

We should clarify this existing behavior by:

* Extending the primary key example to demonstrate updating an object that already has the newly assigned primary key. A model with an additional, non-primary-key field would help illustrate which data is updated.
* Expanding [https://docs.djangoproject.com/en/dev/topics/forms/modelforms/#selecting-the-fields-to-use Selecting the fields to use] to explain the consequences of including an editable primary key field, with a link to the model documentation. Applications should exclude this field unless users are intended to be able to change it."	Cleanup/optimization	assigned	Documentation	6.1	Normal		not-security		Unreviewed	1	0	0	0	0	0
