예제 #1
0
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)
예제 #2
0
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)
예제 #3
0
def restaurantMenuJSON(restaurant_id):
  items = restaurant_dao.getMenuItemsByRestaurant(restaurant_id)
  return jsonify(MenuItems=[i.serialize for i in items])