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()
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()
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()