ohmyapi 0.2.4__py3-none-any.whl → 0.2.5__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
@@ -81,8 +81,8 @@ class Project:
81
81
 
82
82
  # Attach routers from apps
83
83
  for app_name, app_def in self._apps.items():
84
- if app_def.router:
85
- app.include_router(app_def.router)
84
+ for router in app_def.routers:
85
+ app.include_router(router)
86
86
 
87
87
  # Startup / shutdown events
88
88
  @app.on_event("startup")
@@ -333,16 +333,23 @@ class App:
333
333
  module: out,
334
334
  }
335
335
 
336
+ @property
337
+ def routers(self):
338
+ out = []
339
+ for routes_mod in self._routers:
340
+ for r in self._routers[routes_mod]:
341
+ out.append(r)
342
+ return out
343
+
336
344
  @property
337
345
  def routes(self):
338
346
  """
339
347
  Return an APIRouter with all loaded routes.
340
348
  """
341
- router = APIRouter()
342
- for routes_mod in self._routers:
343
- for r in self._routers[routes_mod]:
344
- router.include_router(r)
345
- return router.routes
349
+ out = []
350
+ for r in self.routers:
351
+ out.extend(r.routes)
352
+ return out
346
353
 
347
354
  def dict(self) -> Dict[str, Any]:
348
355
  """
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ohmyapi
3
- Version: 0.2.4
3
+ Version: 0.2.5
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=90nZQwMxrOn0n7b2XI393ERX3Jem2bd4EJrUdUZLh8U,11849
12
+ ohmyapi/core/runtime.py,sha256=Zs2080IXOamzs1TIRVCX-oWh93uJHumtYUwMZKtRwFY,11958
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.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,,
25
+ ohmyapi-0.2.5.dist-info/METADATA,sha256=lZw4-WY9rahDJboBp1q0RNAxrzErYkA7p3lnz4RyVYo,2575
26
+ ohmyapi-0.2.5.dist-info/WHEEL,sha256=M5asmiAlL6HEcOq52Yi5mmk9KmTVjY2RDPtO4p9DMrc,88
27
+ ohmyapi-0.2.5.dist-info/entry_points.txt,sha256=wb3lw8-meAlpiv1mqcQ3m25ukL7djagU_w89GkrC37k,43
28
+ ohmyapi-0.2.5.dist-info/RECORD,,