backend/med_backend/db/models/__init__.py

16 lines
402 B
Python
Raw Normal View History

"""loads all models from models folder"""
2022-12-07 20:16:44 +03:00
import pkgutil
from pathlib import Path
def load_all_models() -> None:
"""Load all models from this folder."""
package_dir = Path(__file__).resolve().parent
modules = pkgutil.walk_packages(
path=[str(package_dir)],
prefix="med_backend.db.models.",
)
for module in modules:
__import__(module.name) # noqa: WPS421