Esempio n. 1
0
  def post(self):
    food_name = self.request.get('food_name')
	food = Food(parent=food_key(food_name),
				food.price = self.request.get('price'),
				food.picture = )

	food.put()
	self.redirect('/?' + urllib.urlencode({'food_name': food_name}))
Esempio n. 2
0
    def post(self):
        the_fav_food = self.request.get('user-fav-food')

        #put into database (optional)
        food_record = Food(food_name=the_fav_food)
        food_record.put()

        #pass to the template via a dictionary
        variable_dict = {'fav_food_for_view': the_fav_food}
        end_template = jinja_current_dir.get_template("templates/results.html")
        self.response.write(end_template.render(variable_dict))
Esempio n. 3
0
 def post(self):
     the_fav_food = self.request.get('user-fav-food')
     
     #put into database (optional)
     food_record = Food(food_name = the_fav_food)
     food_record.put()
     
     #pass to the template via a dictionary
     variable_dict = {'fav_food_for_view': the_fav_food}
     end_template = jinja_current_dir.get_template("templates/results.html")
     self.response.write(end_template.render(variable_dict))
    def post(self):
        expiration_string = self.request.get('expirationdate')
        expiration_date = datetime.datetime.strptime(expiration_string,
                                                     "%Y-%m-%d").date()

        # calendar_url = "http://www.google.com/calendar/event?action=TEMPLATE&text=%s&dates=%s/%s"
        # calendar_link = calendar_url % ("TestEvent", 7, 12) #calendar_start, calendar_end)
        # calendar_html = "<HTML><BODY><A href='%s' target='_blank'>Test Event Link</A></BODY></HTML>"
        # self.response.write(calendar_html % calendar_link)
        user = users.get_current_user()
        food_input = self.request.get('addfooditem')
        #put into database (optional)
        food_record = Food(food_name=food_input,
                           user_id=user.user_id(),
                           expiration_date=expiration_date)
        food_record.put()
        self.redirect('/input')