mirror of
https://github.com/django/django.git
synced 2025-08-03 10:34:04 +00:00
Fixed #26985 -- Doc'd that ForeignKey.to_field reference must be unique.
This commit is contained in:
parent
364293529b
commit
9da45ff352
2 changed files with 3 additions and 1 deletions
|
@ -1424,7 +1424,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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue