🐛 Remember to alias builtin apps before inferring

This commit is contained in:
Brian Wiborg 2025-10-02 14:46:32 +02:00
parent 63d2c31763
commit bb8884f419
No known key found for this signature in database

View file

@ -45,6 +45,8 @@ class ModelMeta(type(TortoiseModel)):
inferred_app = module_parts[-2] inferred_app = module_parts[-2]
else: else:
inferred_app = module_parts[-1] inferred_app = module_parts[-1]
# Rewrite builtin apps to ohmyapi_* alias
inferred_app = inferred_app.replace("ohmyapi.builtin.", "ohmyapi_")
meta.app = inferred_app meta.app = inferred_app
# Prefix table name if not explicitly set # Prefix table name if not explicitly set