示例#1
0
    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()
示例#2
0
 def __init__(self, dataset):
     self._dataset = dataset
     self._id = None
     self._mutation = datastore_pb.Mutation()
     self._auto_id_entities = []
示例#3
0
 def mutation(self):
     if self.transaction():
         return self.transaction().mutation()
     else:
         return datastore_pb.Mutation()