示例#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()