Beispiel #1
0
def cuisineJSON(cuisine_id):
    '''JSON endpoint for a single cuisine

    Includes all restaurants with that cuisine, all base menu items
    for that cuisine, and all restaurant menu items based on that cuisine
    '''
    cuisine = DataManager.getCuisine(cuisine_id=cuisine_id)
    baseMenuItems = DataManager.getBaseMenuItems(cuisine_id=cuisine_id)
    restaurants = DataManager.getRestaurants(cuisine_id=cuisine_id)
    restaurantMenuItems = DataManager.\
                          getRestaurantMenuItems(cuisine_id=cuisine_id)

    return jsonify(Cuisine=cuisine.serialize,
                   BaseMenuItems=[i.serialize for i in baseMenuItems],
                   Restaurants=[i.serialize for i in restaurants],
                   RestaurantMenuItems=\
                    [i.serialize for i in restaurantMenuItems])
Beispiel #2
0
def cuisineJSON(cuisine_id):
    '''JSON endpoint for a single cuisine

    Includes all restaurants with that cuisine, all base menu items
    for that cuisine, and all restaurant menu items based on that cuisine
    '''
    cuisine = DataManager.getCuisine(cuisine_id=cuisine_id)
    baseMenuItems = DataManager.getBaseMenuItems(cuisine_id=cuisine_id)
    restaurants = DataManager.getRestaurants(cuisine_id=cuisine_id)
    restaurantMenuItems = DataManager.\
                          getRestaurantMenuItems(cuisine_id=cuisine_id)

    return jsonify(Cuisine=cuisine.serialize,
                   BaseMenuItems=[i.serialize for i in baseMenuItems],
                   Restaurants=[i.serialize for i in restaurants],
                   RestaurantMenuItems=\
                    [i.serialize for i in restaurantMenuItems])
Beispiel #3
0
def restaurantsJSON():
    '''JSON endpoint for all restaurants
    '''
    restaurants = DataManager.getRestaurants()

    return jsonify(Restaurants=[i.serialize for i in restaurants])
Beispiel #4
0
def restaurantsJSON():
    '''JSON endpoint for all restaurants
    '''
    restaurants = DataManager.getRestaurants()

    return jsonify(Restaurants=[i.serialize for i in restaurants])