Fixed #26985 -- Doc'd that ForeignKey.to_field reference must be unique.

This commit is contained in:
Jonatas CD 2016-11-14 10:18:41 +01:00 committed by Tim Graham
parent 364293529b
commit 9da45ff352
2 changed files with 3 additions and 1 deletions

View File

@ -382,6 +382,7 @@ answer newbie questions, and generally made Django that much better:
Jökull Sólberg Auðunsson <jokullsolberg@gmail.com> Jökull Sólberg Auðunsson <jokullsolberg@gmail.com>
Jon Dufresne <jon.dufresne@gmail.com> Jon Dufresne <jon.dufresne@gmail.com>
Jonas Haag <jonas@lophus.org> Jonas Haag <jonas@lophus.org>
Jonatas C. D. <jonatas.cd@gmail.com>
Jonathan Buchanan <jonathan.buchanan@gmail.com> Jonathan Buchanan <jonathan.buchanan@gmail.com>
Jonathan Daugherty (cygnus) <http://www.cprogrammer.org/> Jonathan Daugherty (cygnus) <http://www.cprogrammer.org/>
Jonathan Feignberg <jdf@pobox.com> Jonathan Feignberg <jdf@pobox.com>

View File

@ -1424,7 +1424,8 @@ The possible values for :attr:`~ForeignKey.on_delete` are found in
.. attribute:: ForeignKey.to_field .. attribute:: ForeignKey.to_field
The field on the related object that the relation is to. By default, Django 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 .. attribute:: ForeignKey.db_constraint