def mutation(self): """Getter for mutation usable with current connection. :rtype: :class:`gcloud.datastore.datastore_v1_pb2.Mutation`. :returns: the mutation instance associated with the current transaction (if one exists) or or a new mutation instance. """ if self.transaction(): return self.transaction().mutation() else: return datastore_pb.Mutation()
def __init__(self, dataset): self._dataset = dataset self._id = None self._mutation = datastore_pb.Mutation() self._auto_id_entities = []
def mutation(self): if self.transaction(): return self.transaction().mutation() else: return datastore_pb.Mutation()