Esempio n. 1
0
	def post(self):
		try:
			# get the data that they wish to add
			city = self.request.get('city')
			miles = self.request.get('miles')

			# if the user has input something for BOTH fields
			if city and miles:
				newMilestone = Milestone(id = city, city_name = city, goalMiles = float(miles))
				newMilestone.put()

			self.redirect('/milestones')
		except Exception, e:
			logging.error(e)
			self.response.out.write('Error adding milestone to datastore!')
			self.response.out.write(e)