🩹 This app's models only

This commit is contained in:
Brian Wiborg 2025-10-02 02:45:14 +02:00
parent 37d807eb65
commit 63a4f4f948
No known key found for this signature in database

View file

@ -257,6 +257,8 @@ class App:
and issubclass(value, Model)
and not name == Model.__name__
):
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