Fix Client Groups circular imports and module dependencies

This commit is contained in:
A R R R Associates
2026-07-25 22:58:07 +05:30
parent ea0f3a1802
commit 2ea0ba907a
3 changed files with 37 additions and 6 deletions
+27 -2
View File
@@ -1,4 +1,29 @@
from .api import router as api_router
from .ui import router as ui_router
"""Clients module.
Routers are exposed lazily so importing ``app.modules.clients.models`` does
not initialise the clients API, UI, importer, and related modules. This keeps
the existing ``api_router`` and ``ui_router`` public exports while preventing
circular imports with client groups.
"""
from __future__ import annotations
from typing import Any
__all__ = ["api_router", "ui_router"]
def __getattr__(name: str) -> Any:
if name == "api_router":
from .api import router
return router
if name == "ui_router":
from .ui import router
return router
raise AttributeError(
f"module {__name__!r} has no attribute {name!r}"
)