Unresolved attribute reference 'objects' for class 'MyModel' on appearing even with the license activated

When defining a Django model and creating a filter like `MyModel.objects.filter(...)`, PyCharm says: Unresolved attribute reference 'objects' for class 'MyModel'.

One detail, this is not the first time this has happened to me using Linux, I currently use ZorinOS

How can I solve this? My environment is ok, I use the PRO version of PyCharm. I program easily on MacOS and Windows, but when I get to Linux, this appears. Can anyone help me?

3

Hi Jhonatanrian Jr, this is 2025.1 version, right? If so, there is a known issue PY-80435, unfortunately. Please feel free to vote / comment. See this article if you are not familiar with YouTrack.

Please check, if installing django-stubs package manually helps.

2

Also same: Unresolved attribute reference 'objects' for class 'MyModel'
After installed django-stubs it fixed that “Unresolved attribute…” problem, but caused another:
- in templates raised: Unresolved tag 'load'

After uninstalled django-stubs fixed Unresolved tag 'load', but raised again Unresolved attribute…”

Vice versa.

Tried invalidate cache, still the same.

0

Justas Balčiūnas, as a general troubleshooting step, please try updating to the latest 2025.1.3.1 version of PyCharm and check if the issue persists.

If updating doesn't help, please create an issue on YouTrack (https://youtrack.jetbrains.com/issues/PY) and attach all relevant information for quicker resolution.
 

0

请先登录再写评论。