コード例 #1
0
ファイル: profile.py プロジェクト: amirdhagopal/lets-share
	def save_profile(self, profileContent, profile = Profile()):
		if profile is None:
			profile = Profile()

		for name, property_type in Profile.properties().items():
			logging.info("Setting Field : " + name)
			value = utils.cast(profileContent[name], property_type)			

			setattr(profile, name, value)

		profile.put()
コード例 #2
0
ファイル: transport.py プロジェクト: amirdhagopal/lets-share
	def save_transport(self, transportContent, transport):
		if transport is None:
			transport = Transport()

		for name, property_type in Transport.properties().items():
			logging.info("Setting Field : " + name)
			value = utils.cast(transportContent[name], property_type)			

			setattr(transport, name, value)

		transport.put()
コード例 #3
0
	def save_accommodation(self, accommodationContent, accommodation):
		if accommodation is None:
			accommodation = Accommodation()

		for name, property_type in Accommodation.properties().items():
			logging.info("Setting Field : " + name)
			value = utils.cast(accommodationContent[name], property_type)

			setattr(accommodation, name, value)

		accommodation.put()