mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-12-17 15:55:13 -05:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user