fix: home md not shown

This commit is contained in:
h z
2024-12-10 13:25:17 +00:00
parent 797bf65d4e
commit 79acfb2313
2 changed files with 8 additions and 2 deletions

View File

@@ -49,13 +49,11 @@ def create_all():
def init_payload():
from db.models import table_models
with get_db() as session:
session.execute(text("SET FOREIGN_KEY_CHECKS = 0;"))
for model in table_models:
print(f"MODEL -- {model}, {hasattr(model, '__pay_load__')}")
if hasattr(model, "__pay_load__"):
payload =model.__pay_load__[ENVIRONMENT]
print(f"- - [ - ] hasattr, {ENVIRONMENT} - {payload}")
stmt = insert(model.__table__).values(payload).prefix_with("IGNORE")

View File

@@ -19,3 +19,11 @@ class Markdown(Base):
'created_at': self.created_at,
'path_id': self.path_id,
}
__pay_load__ = {
'dev': [
{'id': 1, 'title': 'index', 'content': ' ', 'created_at': datetime.datetime.utcnow, 'path_id': 1 },
],
'prod': [
{'id': 1, 'title': 'index', 'content': ' ', 'created_at': datetime.datetime.utcnow, 'path_id': 1},
]
}