def post(self, restaurantid): restaurant = Restaurant.get_by_id(int(restaurantid)) if self.request.get("action") == "additem": item = Item( name = self.request.get("name"), description = self.request.get("description"), price = self.request.get("price"), restaurant = restaurant, ) item.put() restaurant.numberofitems += 1 restaurant.put() doc = helpers.createitemdocument(item, restaurant) self.redirect('/_a/restaurant/' + str(restaurant.key().id()))
def updateindex(self): helpers.createitemdocument(self, self.restaurant)