mode.field_name: (fields.W342) Setting unique=True on a ForeignKey has the
same effect as using a OneToOneField.
HINT: ForeignKey(unique=True) is usually better served by a
OneToOneField.
We found that ForeignKey with unique scales usually better for two
reasons:
1) no need to handle None
2) changing from unique to non-unique is straight forward as one already
works with collections
Is there a way to suppress/remove that warning ?
--
Ticket URL: <https://code.djangoproject.com/ticket/26044>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* status: new => closed
* needs_better_patch: => 0
* component: Core (Management commands) => Core (System checks)
* needs_tests: => 0
* needs_docs: => 0
* resolution: => invalid
Comment:
Please see the [https://docs.djangoproject.com/en/stable/ref/settings/#std
:setting-SILENCED_SYSTEM_CHECKS SILENCED_SYSTEM_CHECKS] setting.
In the future, ask usage questions using our support channels linked from
TicketClosingReasons/UseSupportChannels. Thanks!
--
Ticket URL: <https://code.djangoproject.com/ticket/26044#comment:1>
Comment (by srkunze):
Thanks for pointing me in that direction. However, we found that there is
no reason to recommend OneToOneField as system checks do. From our
perspective it encourages suboptimal design.
--
Ticket URL: <https://code.djangoproject.com/ticket/26044#comment:2>
Comment (by timgraham):
There was some debate about it on the original ticket (#23338). If you
want it considered for removal, you should raise your argument on the
DevelopersMailingList.
--
Ticket URL: <https://code.djangoproject.com/ticket/26044#comment:3>
* cc: tzanke@… (added)
--
Ticket URL: <https://code.djangoproject.com/ticket/26044#comment:4>