-
-
Notifications
You must be signed in to change notification settings - Fork 531
Open
Labels
bugSomething isn't workingSomething isn't workingmypy-pluginIssues specific to mypy_django_pluginIssues specific to mypy_django_plugin
Description
Bug report
It seem we get an weird behavior on custom manager when subclassing an abstract model defined on another module.
What's wrong
Following the official suggestions I have:
# module A
class MyQuerySet(models.Queryset):
# my methods
MyManager = models.Manager.from_queryset(MyQuerySet)
class BaseModel(models.Model):
# model fields
objects = MyManager()
# On module B
from module_a import BaseModel
class MyModel(BaseModel)
# more fieldsOn the initial run and presuming I have no other error everything works fine. With any code change
I get errors Could not resolve manager type for "module_b.MyModel" .
The weird thing is that if I erase the .mypy_cache dir mypy want complain, but again on every code change
the errors get back.
System information
- OS: Ubuntu 22.04
pythonversion: 3.9djangoversion: 4.0mypyversion: 0.961django-stubsversion: 1.12.0django-stubs-extversion: 0.5.0
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingmypy-pluginIssues specific to mypy_django_pluginIssues specific to mypy_django_plugin