For example, does it need to be an `IntegerField` or can it be any field
(trying it out, it seems that a `CharField` works without issues).
One restriction which is caught by Django's validation framework is that
the field needs to have `unique=True` (this is the error fields.E311) but
I don't know if there are more.
--
Ticket URL: <https://code.djangoproject.com/ticket/26985>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* stage: Unreviewed => Accepted
--
Ticket URL: <https://code.djangoproject.com/ticket/26985#comment:1>
* owner: nobody => Jonatas CD
* status: new => assigned
--
Ticket URL: <https://code.djangoproject.com/ticket/26985#comment:2>
* has_patch: 0 => 1
Comment:
Based on a search into the code, you can find uses with `CharField`,
`EmailField`, `IntegerField`, `PositiveIntegerField`, `UUIDField`.
But in all cases indeed the referenced field has to be `unique=True`.
Apart from that I didn't see any other restriction.
[https://github.com/django/django/pull/7553 Patch added] updating
documentation.
--
Ticket URL: <https://code.djangoproject.com/ticket/26985#comment:3>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"9da45ff352db1d1b7c64e5c724e9b0b31822b967" 9da45ff]:
{{{
#!CommitTicketReference repository=""
revision="9da45ff352db1d1b7c64e5c724e9b0b31822b967"
Fixed #26985 -- Doc'd that ForeignKey.to_field reference must be unique.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/26985#comment:4>
Comment (by Tim Graham <timograham@…>):
In [changeset:"af0f01558bb53553a1a7cd24f8121163c0069c85" af0f015]:
{{{
#!CommitTicketReference repository=""
revision="af0f01558bb53553a1a7cd24f8121163c0069c85"
[1.10.x] Fixed #26985 -- Doc'd that ForeignKey.to_field reference must be
unique.
Backport of 9da45ff352db1d1b7c64e5c724e9b0b31822b967 from master
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/26985#comment:5>