예제 #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 __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)
예제 #3
0
class _NoCommitBatch(object):
    def __init__(self, client):
        from google.cloud.datastore.batch import Batch
        self._client = client
        self._batch = Batch(client)
        self._batch.begin()

    def __enter__(self):
        self._client._push_batch(self._batch)
        return self._batch

    def __exit__(self, *args):
        self._client._pop_batch()
예제 #4
0
class _NoCommitBatch(object):

    def __init__(self, client):
        from google.cloud.datastore.batch import Batch
        self._client = client
        self._batch = Batch(client)
        self._batch.begin()

    def __enter__(self):
        self._client._push_batch(self._batch)
        return self._batch

    def __exit__(self, *args):
        self._client._pop_batch()
예제 #5
0
 def batch(self):
     """Proxy to :class:`google.cloud.datastore.batch.Batch`."""
     return Batch(self)
예제 #6
0
 def __init__(self, client):
     from google.cloud.datastore.batch import Batch
     self._client = client
     self._batch = Batch(client)
     self._batch.begin()
예제 #7
0
 def __init__(self, client):
     from google.cloud.datastore.batch import Batch
     self._client = client
     self._batch = Batch(client)
     self._batch.begin()