def upsert(person): if type(person) == list: return list(map(lambda p: upsert(p), person)) id = define_id(person) entity = Datastore.upsert(KIND, person, id=id) logger.debug('Upsert person %s', id) return Datastore.entity_to_dict(entity)
def upsert(detail): if type(detail) == list: return list(map(lambda d: upsert(d), detail)) id = define_id(detail) entity = Datastore.upsert(KIND, detail, id=id) logger.debug('Upsert detail %s', id) return Datastore.entity_to_dict(entity)
def upsert(cluster): if type(cluster) == list: return list(map(lambda c: upsert(c), cluster)) id = define_id(cluster) entity = Datastore.upsert(KIND, cluster, id=id) logger.debug('Upsert cluster %s', id) return Datastore.entity_to_dict(entity)