diff --git a/src/ohmyapi/core/runtime.py b/src/ohmyapi/core/runtime.py index 6778024..1db676f 100644 --- a/src/ohmyapi/core/runtime.py +++ b/src/ohmyapi/core/runtime.py @@ -257,7 +257,9 @@ class App: and issubclass(value, Model) and not name == Model.__name__ ): - self._models[mod_name] = self._models.get(mod_name, []) + [value] + value.__module__ = value.__module__.replace("ohmyapi.builtin.", "ohmyapi_") + if value.__module__.startswith(mod_name): + self._models[mod_name] = self._models.get(mod_name, []) + [value] # if it's a package, recurse into submodules if hasattr(mod, "__path__"):