Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why do I need to do 2 imports for datastore transactions? #684

Closed
jgeewax opened this issue Mar 3, 2015 · 1 comment
Closed

Why do I need to do 2 imports for datastore transactions? #684

jgeewax opened this issue Mar 3, 2015 · 1 comment
Assignees
Labels
api: datastore Issues related to the Datastore API.

Comments

@jgeewax
Copy link
Contributor

jgeewax commented Mar 3, 2015

What I see in the docs:

>>> from gcloud import datastore
>>> from gcloud.datastore.transaction import Transaction
>>> datastore.set_defaults()
>>> with Transaction():
...     datastore.put([entity1, entity2])

What I want to do:

>>> from gcloud import datastore
>>> with datastore.Transaction() as t:
...     t.put([entity1, entity2])
@jgeewax jgeewax added api: datastore Issues related to the Datastore API. docs labels Mar 3, 2015
@jgeewax jgeewax added this to the Datastore Stable milestone Mar 3, 2015
@dhermes
Copy link
Contributor

dhermes commented Mar 3, 2015

Those docs are old. The one you want is preferred.

The __init__ module in the datastore package has every relevant class or public method imported.

The set defaults statement is also no longer needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: datastore Issues related to the Datastore API.
Projects
None yet
Development

No branches or pull requests

2 participants