Объекты Django Models не могут найти объявление для перехода к

У меня есть простое приложение django. Внутри папки models.py у меня есть:

class TestModel(models.Model):
    name = models.CharField(max_length=300)

    def get_all(self):
        all = TestModel.objects.all()
        return all

Even though I have instances of TestModel in my database (PostgreSQL), the function get_all returns None. PyCharm helped me in narrowing down the problem by marking objects and telling me that it Cannot find a declaration to go to. If I create the project with PyCharm Professional through the UI, this problem does not occur. As soon as I open the application through PyCharm Community, the problem appears and does NOT go away by switching back to Professional.

Версия Django - 3.2.9 и 4.0.0 протестированы

Вопросы:

  1. How to make the Django recognize objects by using PyCharm Community?
  2. What is the cause for this strange behaviour?
Вернуться на верх