Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 0 additions & 17 deletions gcloud/datastore/transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,23 +70,6 @@ class Transaction(Batch):
...
>>> assert not entity.key.is_partial # There *is* an ID.

After completion, you can determine if a commit succeeded or failed.
For example, trying to delete a key that doesn't exist::

>>> with datastore.Transaction() as xact:
... xact.delete(key)
...
>>> xact.succeeded
False

or successfully storing two entities:

>>> with datastore.Transaction() as xact:
... datastore.put([entity1, entity2])
...
>>> xact.succeeded
True

If you don't want to use the context manager you can initialize a
transaction manually::

Expand Down