Lazy import of database classes.
()
| 35 | |
| 36 | |
| 37 | def _get_db_classes(): |
| 38 | """Lazy import of database classes.""" |
| 39 | global _create_database, _Feature |
| 40 | if _create_database is None: |
| 41 | import sys |
| 42 | from pathlib import Path |
| 43 | root = Path(__file__).parent.parent.parent |
| 44 | if str(root) not in sys.path: |
| 45 | sys.path.insert(0, str(root)) |
| 46 | from api.database import Feature, create_database |
| 47 | _create_database = create_database |
| 48 | _Feature = Feature |
| 49 | return _create_database, _Feature |
| 50 | |
| 51 | |
| 52 | router = APIRouter(prefix="/api/projects/{project_name}/features", tags=["features"]) |
no outgoing calls
no test coverage detected