Пример #1
0
def showMenuXML(restaurant_id): 
    restaurant = db.getRestaurant( restaurant_id )
    items      = db.getAllRestaurantMenuItems( restaurant )
    
    xml = Element('restaurant')
    xml.set('id', str(restaurant.id))
    xml.set('name', restaurant.name)
    for item in items:
        xml.append(item.serialize_xml)

    return xmlResponse(xml)
Пример #2
0
def showMenuXML(restaurant_id):
    restaurant = db.getRestaurant(restaurant_id)
    items = db.getAllRestaurantMenuItems(restaurant)

    xml = Element('restaurant')
    xml.set('id', str(restaurant.id))
    xml.set('name', restaurant.name)
    for item in items:
        xml.append(item.serialize_xml)

    return xmlResponse(xml)
Пример #3
0
def showmenu(restaurant_id):
    # Get user info for the user menu
    user = userData.getCurrentUserInfo()

    # Fetches the context restaurant
    restaurant = db.getRestaurant(restaurant_id)

    # Fetches all items from the context restaurant
    items = db.getAllRestaurantMenuItems(restaurant)

    # Fetches all courses type, and respective menu items
    courses = db.getAllRestItemsByCourses(restaurant)

    # Render template
    return render_template('menu.html',
                           filesPath=filesHandler.getFilesFolder(),
                           restaurant=restaurant,
                           items=list(items),
                           courses=courses,
                           user_id=user['id'],
                           username=user['name'],
                           user_picture=user['picture'])
Пример #4
0
def showmenu(restaurant_id):
    # Get user info for the user menu
    user = userData.getCurrentUserInfo()

    # Fetches the context restaurant
    restaurant = db.getRestaurant( restaurant_id )
    
    # Fetches all items from the context restaurant
    items = db.getAllRestaurantMenuItems( restaurant )

    # Fetches all courses type, and respective menu items
    courses = db.getAllRestItemsByCourses( restaurant )

    # Render template
    return render_template(
        'menu.html',
        filesPath = filesHandler.getFilesFolder(),
        restaurant = restaurant,
        items = list(items), 
        courses = courses, 
        user_id = user['id'], 
        username = user['name'],
        user_picture = user['picture'] 
    )
Пример #5
0
def showMenuJSON(restaurant_id): 
    restaurant = db.getRestaurant( restaurant_id )
    items      = db.getAllRestaurantMenuItems( restaurant )
    return jsonify( MenuItems=[i.serialize_json for i in items] )
Пример #6
0
def showMenuJSON(restaurant_id):
    restaurant = db.getRestaurant(restaurant_id)
    items = db.getAllRestaurantMenuItems(restaurant)
    return jsonify(MenuItems=[i.serialize_json for i in items])