Unresolved attribute references for Django's ForeignKey field etc.
Hi,
When I use PyCharm for my Django projects, I often suffer from PyCharm being unable to link attributes of a related model to corresponding ForeignKey (etc.) field. This results in lots of inspection warnings (underlines). Is there a way to make PyCharm recognize related model attributes?
Thanks,
Andrei
When I use PyCharm for my Django projects, I often suffer from PyCharm being unable to link attributes of a related model to corresponding ForeignKey (etc.) field. This results in lots of inspection warnings (underlines). Is there a way to make PyCharm recognize related model attributes?
Example
from django.db import models class ModelA(models.Model): some_field = models.BooleanField() class ModelB(models.Model): model_a = models.ForeignKey(ModelA) def related_property(self): return self.model_a.some_field # "some_field" is unresolved
Thanks,
Andrei
1 条评论
排序方式
日期
投票数
YouTrack issue: http://youtrack.jetbrains.com/issue/PY-9211
请先登录再写评论。