예제 #1
0
 def __init__(self, client, transaction_id='TRANSACTION'):
     from google.cloud.datastore.batch import Batch
     from google.cloud.datastore.transaction import Transaction
     self._client = client
     xact = self._transaction = Transaction(client)
     xact._id = transaction_id
     Batch.begin(xact)
예제 #2
0
    def transaction(self, **kwargs):
        """Proxy to :class:`google.cloud.datastore.transaction.Transaction`.

        :type kwargs: dict
        :param kwargs: Keyword arguments to be passed in.
        """
        return Transaction(self, **kwargs)
예제 #3
0
 def transaction(self):
     """Proxy to :class:`google.cloud.datastore.transaction.Transaction`."""
     return Transaction(self)