Beispiel #1
0
    def index(self):
        self.recipes = Recipe.load_all_public()

        # Filter recipes
        if ingredient := self.form.ingredient.data:
            self.recipes = [
                r for r in self.recipes if ingredient in r.ingredients
            ]
Beispiel #2
0
 def before_request(self, name, *args, **kwargs):
     self.recipes = Recipe.load_all_public()