You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for the report, @stecik. Fixed in #136 and merged to main. It will go out in the next release of both the extension and the CLI.
There was nothing wrong with the inheritance itself. The scan only reads models.py, abstract_models.py and models/*.py, so a base living in, say, core/base.py had no definition to resolve against, and everything below it got dropped. The scan now follows your model's imports to the file that defines the base, so no configuration is needed. That covers:
from core.base import MyCustomModel and relative from .base import MyCustomModel
module aliases, such as from core import base → class Person(base.MyCustomModel)
re-exports through a package __init__.py
chains, where your base inherits from another base in yet another file
Fields from an abstract base show up as inherited fields on Person, the same as when the base sits in models.py.
One limit: the base has to live inside the workspace. If yours comes from an installed package rather than your own code, please say so here and I'll look at a setting for that case.
Activity
FROWNINGdev commentedon Oct 8, 2026
Thanks for the report, @stecik. Fixed in #136 and merged to
main. It will go out in the next release of both the extension and the CLI.There was nothing wrong with the inheritance itself. The scan only reads
models.py,abstract_models.pyandmodels/*.py, so a base living in, say,core/base.pyhad no definition to resolve against, and everything below it got dropped. The scan now follows your model's imports to the file that defines the base, so no configuration is needed. That covers:from core.base import MyCustomModeland relativefrom .base import MyCustomModelfrom core import base→class Person(base.MyCustomModel)__init__.pyFields from an abstract base show up as inherited fields on
Person, the same as when the base sits inmodels.py.One limit: the base has to live inside the workspace. If yours comes from an installed package rather than your own code, please say so here and I'll look at a setting for that case.
release: py-1.13.2, v0.19.4 — model bases outside models.py (#135) (#137