def restaurantMenus(): restaurants = restaurant_dao.getRestaurants() restaurants_arr = [] for restaurant in restaurants: items = restaurant_dao.getMenuItemsByRestaurant(restaurant.id) setattr(restaurant, "items", items) restaurants_arr.append(restaurant) return render_template('restaurants.html', restaurants=restaurants_arr)
def restaurantMenu(restaurant_id): restaurant = restaurant_dao.getRestaurant(restaurant_id) items = restaurant_dao.getMenuItemsByRestaurant(restaurant_id) return render_template('restaurant.html', restaurant=restaurant, items=items)
def restaurantMenuJSON(restaurant_id): items = restaurant_dao.getMenuItemsByRestaurant(restaurant_id) return jsonify(MenuItems=[i.serialize for i in items])