def delete(id): """Softdeletes a dish""" Dish.update(isDeleted=True).where(Dish.id == id).execute() flash('Dish deleted', 'success') return redirect(url_for('caterers.index'))
def restore(id): """Restores a soft deleted dish""" Dish.update(isDeleted=False).where(Dish.id == id).execute() flash('Dish restored', 'success') return redirect(url_for('dishes.edit', id=id))
def processEdit(id, name, price, caterer): """Updates a dish based on POST data""" Dish.update(name=name, price=price, caterer=Caterer.select().where(Caterer.id == caterer).get()).where(Dish.id == id).execute() flash("Dish updated", 'success') return redirect(url_for('caterers.index'))