mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-07-31 14:34:42 -04:00
notes hot fix
This commit is contained in:
parent
d0faa52cfd
commit
2338f017ed
@ -54,8 +54,8 @@ app.include_router(static_routes.router)
|
|||||||
|
|
||||||
|
|
||||||
# Generate API Documentation
|
# Generate API Documentation
|
||||||
if not PRODUCTION:
|
# if not PRODUCTION:
|
||||||
generate_api_docs(app)
|
# generate_api_docs(app)
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
logger.info("-----SYSTEM STARTUP-----")
|
logger.info("-----SYSTEM STARTUP-----")
|
||||||
|
@ -15,7 +15,9 @@ def globa_init(db_file: Path):
|
|||||||
return
|
return
|
||||||
conn_str = "sqlite:///" + str(db_file.absolute())
|
conn_str = "sqlite:///" + str(db_file.absolute())
|
||||||
|
|
||||||
engine = sa.create_engine(conn_str, echo=False)
|
engine = sa.create_engine(
|
||||||
|
conn_str, echo=False, connect_args={"check_same_thread": False}
|
||||||
|
)
|
||||||
|
|
||||||
__factory = orm.sessionmaker(bind=engine)
|
__factory = orm.sessionmaker(bind=engine)
|
||||||
|
|
||||||
|
@ -50,6 +50,10 @@ class Note(SqlAlchemyBase):
|
|||||||
title = sa.Column(sa.String)
|
title = sa.Column(sa.String)
|
||||||
text = sa.Column(sa.String)
|
text = sa.Column(sa.String)
|
||||||
|
|
||||||
|
def __init__(self, title, text) -> None:
|
||||||
|
self.title = title
|
||||||
|
self.text = text
|
||||||
|
|
||||||
def dict(self):
|
def dict(self):
|
||||||
return {"title": self.title, "text": self.text}
|
return {"title": self.title, "text": self.text}
|
||||||
|
|
||||||
@ -169,7 +173,7 @@ class RecipeModel(SqlAlchemyBase, BaseMixins):
|
|||||||
self.categories = [Category(name=cat) for cat in categories]
|
self.categories = [Category(name=cat) for cat in categories]
|
||||||
self.tags = [Tag(name=tag) for tag in tags]
|
self.tags = [Tag(name=tag) for tag in tags]
|
||||||
self.dateAdded = dateAdded
|
self.dateAdded = dateAdded
|
||||||
self.notes = [Note(note) for note in notes]
|
self.notes = [Note(**note) for note in notes]
|
||||||
self.rating = rating
|
self.rating = rating
|
||||||
self.orgURL = orgURL
|
self.orgURL = orgURL
|
||||||
self.extras = [ApiExtras(key=key, value=value) for key, value in extras.items()]
|
self.extras = [ApiExtras(key=key, value=value) for key, value in extras.items()]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user