mirror of
https://github.com/hay-kot/mealie.git
synced 2025-08-22 06:23:34 -07:00
database abstraction
This commit is contained in:
parent
a28bbf8840
commit
dd3b9666a5
1 changed files with 8 additions and 3 deletions
|
@ -67,9 +67,7 @@ class Recipe(BaseModel):
|
|||
"notes": [{"title": "Watch Out!", "text": "Prep the day before!"}],
|
||||
"orgURL": "https://www.bonappetit.com/recipe/chicken-and-rice-with-leeks-and-salsa-verde",
|
||||
"rating": 3,
|
||||
"extras": {
|
||||
"message": "Don't forget to defrost the chicken!"
|
||||
}
|
||||
"extras": {"message": "Don't forget to defrost the chicken!"},
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -152,6 +150,13 @@ class Recipe(BaseModel):
|
|||
document.update(set__extras=self.extras)
|
||||
document.save()
|
||||
|
||||
@staticmethod
|
||||
def update_image(slug: str, extension: str):
|
||||
document = RecipeDocument.objects.get(slug=slug)
|
||||
|
||||
if document:
|
||||
document.update(set__image=f"{slug}.{extension}")
|
||||
|
||||
|
||||
def read_requested_values(keys: list, max_results: int = 0) -> List[dict]:
|
||||
"""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue