Feature/additional endpoints (#257)

* new recipe summary route

* add categories to cards

* add pillow

* show tags instead of categories

* additional debug info

* add todays meal image url

* about page

* fix reactive tag

* changelog + docs

* bump version

Co-authored-by: hay-kot <hay-kot@pm.me>
This commit is contained in:
Hayden
2021-04-03 11:25:57 -08:00
committed by GitHub
parent 4c3f751e80
commit 764f85fb40
23 changed files with 330 additions and 119 deletions

View File

@@ -15,17 +15,10 @@ class BaseDocument:
self.schema: BaseModel
# TODO: Improve Get All Query Functionality
def get_all(self, session: Session, limit: int = None, order_by: str = None) -> List[dict]:
def get_all(self, session: Session, limit: int = None, order_by: str = None, override_schema=None) -> List[dict]:
eff_schema = override_schema or self.schema
if self.orm_mode:
return [self.schema.from_orm(x) for x in session.query(self.sql_model).limit(limit).all()]
# list = [x.dict() for x in session.query(self.sql_model).limit(limit).all()]
# if limit == 1:
# return list[0]
# return list
return [eff_schema.from_orm(x) for x in session.query(self.sql_model).limit(limit).all()]
def get_all_limit_columns(self, session: Session, fields: List[str], limit: int = None) -> List[SqlAlchemyBase]:
"""Queries the database for the selected model. Restricts return responses to the