Disable single instance of a system check warning

已查看 16 次
跳至第一个未读帖子

Mattias Linnap

未读,
2018年2月9日 06:58:082018/2/9
收件人 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

未读,
2018年2月9日 18:25:382018/2/9
收件人 Django users
There is not, but there's an open ticket for that enhancement. https://code.djangoproject.com/ticket/26472
回复全部
回复作者
转发
0 个新帖子