Unresolved attribute reference 'objects' for class 'Foo'

Why am I seeing the warning "Unresolved attribute reference 'objects' for class 'Foo'" for a class which is a subclass of Django's models.Model?  This occurs wherever I use Foo.objects.filter(...).

Foo is defined as class Foo(models.Model). PyCharm gives no warnings for the import statements in either file.

Example:

models.py
from django.db import models

class Foo(models.Model):
pass

views.py
from models import Foo

inquiry = Foo.objects.filter(...) # PyCharm gives warning for objects here
...
1
1 comment
This is in Django.  Is it a PYTHON_PATH problem?  How can I check?
0

Please sign in to leave a comment.