From 63a4f4f948bbe6fa597e03f6640872bf5fccb16b Mon Sep 17 00:00:00 2001 From: Brian Wiborg Date: Thu, 2 Oct 2025 02:45:14 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=A9=B9=20This=20app's=20models=20only?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/ohmyapi/core/runtime.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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__"):