def post(self):
		postType = cgi.escape(self.request.get('createOrUpdate'))

		business_id = cgi.escape(self.request.get('business_id'))
		if postType == 'hide':
			self.__HideBusiness(business_id)
		else:
			business = Business()

			business.name = cgi.escape(self.request.get('name'))
			business.url = cgi.escape(self.request.get('url'))
			business.province = cgi.escape(self.request.get('province'))
			business.city = cgi.escape(self.request.get('city'))
			business.street = cgi.escape(self.request.get('street'))
			business.phonenumber = cgi.escape(self.request.get('phone'))
			hide = cgi.escape(self.request.get('hide'))
			if hide == 'True':
				business.hidden = True
			else:
				business.hidden = False
		
			if postType == 'update':
				business.business_id = business_id
				BusinessService().updateBusiness(business)
			else:
				BusinessService().saveBusiness(business);
				
		self.redirect('/businessservice/')
Beispiel #2
0
	def convertDbBusinessToBusiness(self, dbBusiness):
		business = None
		if dbBusiness:
			business = Business()
			business.name = dbBusiness.name
			business.url = dbBusiness.url
			business.country = dbBusiness.country
			business.province = dbBusiness.province
			business.city = dbBusiness.city
			business.street = dbBusiness.street
			business.postalcode = dbBusiness.postalcode
			business.phonenumber = dbBusiness.phonenumber
			if dbBusiness.hidden != None:
				business.hidden = dbBusiness.hidden
			business.geolocation = self.convertGeoPTToGeoLocation(dbBusiness.location)
			business.business_id = str(dbBusiness.key().id())
		return business