#26985: Document restrictions on fields that can be referenced by
ForeignKey.to_field
------------------------------------------------+------------------------
               Reporter:  bmispelon             |          Owner:  nobody
                   Type:  Cleanup/optimization  |         Status:  new
              Component:  Documentation         |        Version:  1.10
               Severity:  Normal                |       Keywords:
           Triage Stage:  Unreviewed            |      Has patch:  0
    Needs documentation:  0                     |    Needs tests:  0
Patch needs improvement:  0                     |  Easy pickings:  0
                  UI/UX:  0                     |
------------------------------------------------+------------------------
 As someone who's never used the feature before (I looked at the
 documentation while investigating something else), it's not clear to me if
 there are limitations or restrictions on what kind of fields can be used?

 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.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/052.15d959050d1c724a2aba2009811d06b8%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to