Save Markdowns
This commit is contained in:
@@ -14,4 +14,15 @@ class Path(Base):
|
||||
"id": self.id,
|
||||
"name": self.name,
|
||||
"parent_id": self.parent_id,
|
||||
}
|
||||
}
|
||||
|
||||
__pay_load__ = {
|
||||
'dev': [
|
||||
{'id': 1, 'name': '', 'parent_id': None},
|
||||
{'id': 2, 'name': 'test', 'parent_id': 1},
|
||||
{'id': 3, 'name': 'test1', 'parent_id': 1},
|
||||
],
|
||||
'prod': [
|
||||
{'id': 1, 'name': '', 'parent_id': None},
|
||||
]
|
||||
}
|
||||
@@ -5,6 +5,11 @@ import importlib
|
||||
from sqlalchemy.ext.declarative import declarative_base
|
||||
Base = declarative_base()
|
||||
package_name = "db.models"
|
||||
for _, module_name, _ in pkgutil.iter_modules(__path__):
|
||||
importlib.import_module(f"{package_name}.{module_name}")
|
||||
|
||||
table_models = []
|
||||
for _, module_name, _ in pkgutil.iter_modules(__path__):
|
||||
module = importlib.import_module(f"{package_name}.{module_name}")
|
||||
if hasattr(module, module_name):
|
||||
model = getattr(module, module_name)
|
||||
if hasattr(model, "__tablename__"):
|
||||
table_models.append(model)
|
||||
|
||||
Reference in New Issue
Block a user