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)
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)
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'])
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'] )
def showMenuJSON(restaurant_id): restaurant = db.getRestaurant( restaurant_id ) items = db.getAllRestaurantMenuItems( restaurant ) return jsonify( MenuItems=[i.serialize_json for i in items] )
def showMenuJSON(restaurant_id): restaurant = db.getRestaurant(restaurant_id) items = db.getAllRestaurantMenuItems(restaurant) return jsonify(MenuItems=[i.serialize_json for i in items])