ohmyapi 0.2.3__py3-none-any.whl → 0.2.4__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
ohmyapi/core/runtime.py CHANGED
@@ -257,7 +257,9 @@ class App:
257
257
  and issubclass(value, Model)
258
258
  and not name == Model.__name__
259
259
  ):
260
- self._models[mod_name] = self._models.get(mod_name, []) + [value]
260
+ value.__module__ = value.__module__.replace("ohmyapi.builtin.", "ohmyapi_")
261
+ if value.__module__.startswith(mod_name):
262
+ self._models[mod_name] = self._models.get(mod_name, []) + [value]
261
263
 
262
264
  # if it's a package, recurse into submodules
263
265
  if hasattr(mod, "__path__"):
@@ -300,8 +302,7 @@ class App:
300
302
  for _, subname, _ in pkgutil.iter_modules(
301
303
  mod.__path__, mod.__name__ + "."
302
304
  ):
303
- submod = importlib.import_module(subname)
304
- walk(submod)
305
+ walk(subname)
305
306
 
306
307
  # Walk the walk.
307
308
  walk(mod_name)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ohmyapi
3
- Version: 0.2.3
3
+ Version: 0.2.4
4
4
  Summary: Django-flavored scaffolding and management layer around FastAPI, Pydantic, TortoiseORM and Aerich migrations
5
5
  License-Expression: MIT
6
6
  Keywords: fastapi,tortoise,orm,pydantic,async,web-framework
@@ -9,7 +9,7 @@ ohmyapi/builtin/demo/models.py,sha256=r06rfuhPJaI2fYsQ24L1JCOd67f2GQNfGnkgKAptOX
9
9
  ohmyapi/builtin/demo/routes.py,sha256=1VTlEttrez6Qnhrz_9sTA-emtfXem0s0BkPVcLvg3k0,1801
10
10
  ohmyapi/cli.py,sha256=dJVNgpW5S4rCc619AEEKBKuEIAmQs153Ls0ZVaea48w,4173
11
11
  ohmyapi/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
12
- ohmyapi/core/runtime.py,sha256=6MejxdFxY9zfmAEcFMIly-R5JEhIlzf3hlx9dZWBZrY,11748
12
+ ohmyapi/core/runtime.py,sha256=90nZQwMxrOn0n7b2XI393ERX3Jem2bd4EJrUdUZLh8U,11849
13
13
  ohmyapi/core/scaffolding.py,sha256=SA0SYFd7VcqkOn9xuXgj-yOoVqCZMJo68GGFbm34GE4,2663
14
14
  ohmyapi/core/templates/app/__init__.py.j2,sha256=QwVIQVUGZVhdH1d4NrvL7NTsK4-T4cihzYs8UVX2dt4,43
15
15
  ohmyapi/core/templates/app/models.py.j2,sha256=_3w-vFJ5fgsmncsCv34k_wyCMF78jufbSSglns4gbb0,119
@@ -22,7 +22,7 @@ ohmyapi/db/exceptions.py,sha256=vb4IIUoeYAY6sK42zRtjMy-39IFVi_Qb6mWySTY0jYw,34
22
22
  ohmyapi/db/model/__init__.py,sha256=k3StTNuKatpwZo_Z5JBFa-927eJrzibFE8U4SA82asc,32
23
23
  ohmyapi/db/model/model.py,sha256=ui4g78c5xoS06Dj8Cdk7QgTjRnE68zKeL-AdmeYYPuQ,2776
24
24
  ohmyapi/router.py,sha256=5g0U59glu4hxxnIoTSFzb2S2offkOT3eE39aprzVxwo,83
25
- ohmyapi-0.2.3.dist-info/METADATA,sha256=RwdNl_tbHfK7TWcb5tqp2Yb9RSbtHiQDb2gD1scd_ng,2575
26
- ohmyapi-0.2.3.dist-info/WHEEL,sha256=M5asmiAlL6HEcOq52Yi5mmk9KmTVjY2RDPtO4p9DMrc,88
27
- ohmyapi-0.2.3.dist-info/entry_points.txt,sha256=wb3lw8-meAlpiv1mqcQ3m25ukL7djagU_w89GkrC37k,43
28
- ohmyapi-0.2.3.dist-info/RECORD,,
25
+ ohmyapi-0.2.4.dist-info/METADATA,sha256=Qzo5YjAgaujzOPj-K_ZAgntfq3OLpfxTp9z19zmfdWU,2575
26
+ ohmyapi-0.2.4.dist-info/WHEEL,sha256=M5asmiAlL6HEcOq52Yi5mmk9KmTVjY2RDPtO4p9DMrc,88
27
+ ohmyapi-0.2.4.dist-info/entry_points.txt,sha256=wb3lw8-meAlpiv1mqcQ3m25ukL7djagU_w89GkrC37k,43
28
+ ohmyapi-0.2.4.dist-info/RECORD,,