Open
Description
Bug report
What's wrong
I have the following models:
# Content from video.models
class BackingVideo(AudioMixin):
asset = models.OneToOneField(
"video.Asset", on_delete=models.SET_NULL, null=True, blank=True, related_name="backing_video"
)
class Asset(BaseModelMixin):
mux_asset_id = models.CharField(max_length=512, blank=False)
and when I run mypy on the code base I get this error:
video/management/commands/copy_mux_assets.py:126: error: "Asset" has no attribute "backing_video" [attr-defined]
Found 1 error in 1 file (checked 75 source files)
Which seems a bit strange as I seem to have all of the proper setup.
This is what the relevant pyproject.toml
file looks like:
[tool.mypy]
explicit_package_bases = true
plugins = ["mypy_django_plugin.main", "mypy_drf_plugin.main"]
ignore_missing_imports = false
disallow_untyped_calls = true
disallow_untyped_defs = true
disallow_incomplete_defs = true
check_untyped_defs = true
[tool.django-stubs]
django_settings_module = "config.settings"
Any thoughts on what I might be doing wrong here?
Any help is appreciated. Thx!
System information
- OS:
python
version: 3.13django
version: 5.1.7mypy
version: 1.15.0django-stubs
version: 5.1.3django-stubs-ext
version: 5.1.3