#23338: Warn when unique=True is set on ForeignKey
------------------------------------------------+------------------------
               Reporter:  funkybob              |          Owner:  nobody
                   Type:  New feature           |         Status:  new
              Component:  Core (System checks)  |        Version:  master
               Severity:  Normal                |       Keywords:
           Triage Stage:  Unreviewed            |      Has patch:  0
    Needs documentation:  1                     |    Needs tests:  1
Patch needs improvement:  0                     |  Easy pickings:  1
                  UI/UX:  0                     |
------------------------------------------------+------------------------
 Long ago in the dark times before 1.0, there was a bug in Admin that meant
 using ForeignKey(unique=True) was preferable to using a OneToOneField.

 Somehow, people (on IRC) are still doing this -- even new users-- , and I
 can't figure out why.

 Unless I'm missing something, there is no case where a
 ForeignKey(unique=True) is preferable to a OneToOneField.

 Shouldn't we, then, at least add a check/warn to say this?

-- 
Ticket URL: <https://code.djangoproject.com/ticket/23338>
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 django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/051.d38459e7e54f298d064429ba3900ffd9%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to