fix: home md not shown
This commit is contained in:
@@ -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")
|
||||
|
||||
@@ -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},
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user