diff options
Diffstat (limited to 'docs/ref')
| -rw-r--r-- | docs/ref/models/fields.txt | 4 | ||||
| -rw-r--r-- | docs/ref/models/instances.txt | 11 |
2 files changed, 10 insertions, 5 deletions
diff --git a/docs/ref/models/fields.txt b/docs/ref/models/fields.txt index 4cd1d05b3c..d31a541b73 100644 --- a/docs/ref/models/fields.txt +++ b/docs/ref/models/fields.txt @@ -722,8 +722,8 @@ isn't defined. A virtual field used for defining a composite primary key. -This field must be defined as the model's ``pk`` field. If present, Django will -create the underlying model table with a composite primary key. +This field must be defined as the model's ``pk`` attribute. If present, Django +will create the underlying model table with a composite primary key. The ``*field_names`` argument is a list of positional field names that compose the primary key. diff --git a/docs/ref/models/instances.txt b/docs/ref/models/instances.txt index c2feca1181..7482b98a66 100644 --- a/docs/ref/models/instances.txt +++ b/docs/ref/models/instances.txt @@ -468,9 +468,14 @@ The ``pk`` property Regardless of whether you define a primary key field yourself, or let Django supply one for you, each model will have a property called ``pk``. It behaves like a normal attribute on the model, but is actually an alias for whichever -attribute is the primary key field for the model. You can read and set this -value, just as you would for any other attribute, and it will update the -correct field in the model. +field or fields compose the primary key for the model. You can read and set +this value, just as you would for any other attribute, and it will update the +correct fields in the model. + +.. versionchanged:: 5.2 + + Support for the primary key to be composed of multiple fields was added via + ``CompositePrimaryKey``. Explicitly specifying auto-primary-key values ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
