summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonatas CD <jonatas.cd@gmail.com>2016-11-14 10:18:41 +0100
committerTim Graham <timograham@gmail.com>2016-11-15 11:21:58 -0500
commitaf0f01558bb53553a1a7cd24f8121163c0069c85 (patch)
treecdd22d059c71e9c645073a17c88c2fe39b1d4ad7
parent65cdded2c9ab9987eae117de37a24c752c9ba185 (diff)
[1.10.x] Fixed #26985 -- Doc'd that ForeignKey.to_field reference must be unique.
Backport of 9da45ff352db1d1b7c64e5c724e9b0b31822b967 from master
-rw-r--r--AUTHORS1
-rw-r--r--docs/ref/models/fields.txt3
2 files changed, 3 insertions, 1 deletions
diff --git a/AUTHORS b/AUTHORS
index 52aa5617a4..cc233f1b04 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -375,6 +375,7 @@ answer newbie questions, and generally made Django that much better:
Jökull Sólberg Auðunsson <jokullsolberg@gmail.com>
Jon Dufresne <jon.dufresne@gmail.com>
Jonas Haag <jonas@lophus.org>
+ Jonatas C. D. <jonatas.cd@gmail.com>
Jonathan Buchanan <jonathan.buchanan@gmail.com>
Jonathan Daugherty (cygnus) <http://www.cprogrammer.org/>
Jonathan Feignberg <jdf@pobox.com>
diff --git a/docs/ref/models/fields.txt b/docs/ref/models/fields.txt
index 8fe1d90dea..250311d9e6 100644
--- a/docs/ref/models/fields.txt
+++ b/docs/ref/models/fields.txt
@@ -1426,7 +1426,8 @@ The possible values for :attr:`~ForeignKey.on_delete` are found in
.. attribute:: ForeignKey.to_field
The field on the related object that the relation is to. By default, Django
- uses the primary key of the related object.
+ uses the primary key of the related object. If you reference a different
+ field, that field must have ``unique=True``.
.. attribute:: ForeignKey.db_constraint