def deleteMenuItem(restaurant_id, menu_id): itemToDelete = session.query(MenuItem).filter_by(id=menu_id).one() if request.method == 'POST': session.delete(itemToDelete) session.commit() return redirect(url_for('showMenu', restaurant_id=restaurant_id)) else: return render_template('deleteMenuItem.html', item=itemToDelete)
def deleteMenuItem(restaurant_id, menu_id): itemToDelete = session.query(MenuItem).filter_by(id=menu_id).one() if request.method == 'POST': session.delete(itemToDelete) session.commit() return redirect(url_for('showMenu', restaurant_id=restaurant_id)) else: return render_template('deleteMenuItem.html', item=itemToDelete) # return "This page is for deleting menu item %s" % menu_id
def deleteRestaurant(restaurant_id): restaurantToDelete = session.query( Restaurant).filter_by(id=restaurant_id).one() if request.method == 'POST': session.delete(restaurantToDelete) session.commit() return redirect( url_for('showRestaurants', restaurant_id=restaurant_id)) else: return render_template( 'deleteRestaurant.html', restaurant=restaurantToDelete)
def deleteRestaurant(restaurant_id): restaurantToDelete = session.query(Restaurant).filter_by( id=restaurant_id).one() if request.method == 'POST': session.delete(restaurantToDelete) session.commit() return redirect(url_for('showRestaurants', restaurant_id=restaurant_id)) else: return render_template('deleteRestaurant.html', restaurant=restaurantToDelete)