Disable single instance of a system check warning

16 views
Skip to first unread message

Mattias Linnap

unread,
Feb 9, 2018, 6:58:08 AM2/9/18
to Django users
Hi djangonauts,

System check identified some issues:

HINT: ForeignKey(unique=True) is usually better served by a OneToOneField.


I would like to keep using ForeignKey(unique=True) for this particular model, and mark the warning as disabled for this model only (keep it enabled project-wide for other models).

For example, Java has the @SupressWarnings() annotation, and C++/Clang has the #pragma clang diagnostic ignored block directive.

Is there a way to do this with Python/Django?

Best,

Mattias

Tim Graham

unread,
Feb 9, 2018, 6:25:38 PM2/9/18
to Django users
There is not, but there's an open ticket for that enhancement. https://code.djangoproject.com/ticket/26472
Reply all
Reply to author
Forward
0 new messages