Title: Why do I need to do 2 imports for datastore transactions? · Issue #684 · googleapis/google-cloud-python · GitHub
Open Graph Title: Why do I need to do 2 imports for datastore transactions? · Issue #684 · googleapis/google-cloud-python
X Title: Why do I need to do 2 imports for datastore transactions? · Issue #684 · googleapis/google-cloud-python
Description: 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 gclo...
Open Graph Description: What I see in the docs: >>> from gcloud import datastore >>> from gcloud.datastore.transaction import Transaction >>> datastore.set_defaults() >>> with Transaction(): ... datastore.put([entity1, en...
X Description: What I see in the docs: >>> from gcloud import datastore >>> from gcloud.datastore.transaction import Transaction >>> datastore.set_defaults() >>> with Transacti...
Opengraph URL: https://github.com/googleapis/google-cloud-python/issues/684
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Why do I need to do 2 imports for datastore transactions?","articleBody":"What I see in the docs:\n\n``` python\n\u003e\u003e\u003e from gcloud import datastore\n\u003e\u003e\u003e from gcloud.datastore.transaction import Transaction\n\u003e\u003e\u003e datastore.set_defaults()\n\u003e\u003e\u003e with Transaction():\n... datastore.put([entity1, entity2])\n```\n\nWhat I want to do:\n\n``` python\n\u003e\u003e\u003e from gcloud import datastore\n\u003e\u003e\u003e with datastore.Transaction() as t:\n... t.put([entity1, entity2])\n```\n","author":{"url":"https://github.com/jgeewax","@type":"Person","name":"jgeewax"},"datePublished":"2015-03-03T17:05:08.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/684/google-cloud-python/issues/684"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:bdb5d243-252e-0e52-8f2a-55a511b7ac10 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BEA0:38A7FD:13D444F:1B8ECD0:6A4DEC13 |
| html-safe-nonce | 2e244e546298efc87da0326f5920f9ef722a10a43261a79744a591e266c21611 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCRUEwOjM4QTdGRDoxM0Q0NDRGOjFCOEVDRDA6NkE0REVDMTMiLCJ2aXNpdG9yX2lkIjoiMTIyMTE3MzY5NDk3OTUwMTA3NSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | e434774b1c493e9e619ddc32a1e1821c3daa857046002d0520155d872eb4a96c |
| hovercard-subject-tag | issue:59672211 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/googleapis/google-cloud-python/684/issue_layout |
| twitter:image | https://opengraph.githubassets.com/57f099c1c3fb89d4342bcbf5e32c4f307818f3db131069c115abc1abf42b05a5/googleapis/google-cloud-python/issues/684 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/57f099c1c3fb89d4342bcbf5e32c4f307818f3db131069c115abc1abf42b05a5/googleapis/google-cloud-python/issues/684 |
| og:image:alt | What I see in the docs: >>> from gcloud import datastore >>> from gcloud.datastore.transaction import Transaction >>> datastore.set_defaults() >>> with Transaction(): ... datastore.put([entity1, en... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | jgeewax |
| hostname | github.com |
| expected-hostname | github.com |
| None | 06b8a6144231bf3a234f1c2e9993861e07ce98a905912b114aa386c2d7e84b33 |
| turbo-cache-control | no-preview |
| go-import | github.com/googleapis/google-cloud-python git https://github.com/googleapis/google-cloud-python.git |
| octolytics-dimension-user_id | 16785467 |
| octolytics-dimension-user_login | googleapis |
| octolytics-dimension-repository_id | 16316451 |
| octolytics-dimension-repository_nwo | googleapis/google-cloud-python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 16316451 |
| octolytics-dimension-repository_network_root_nwo | googleapis/google-cloud-python |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 1d344bdb7547fe6bca17a59bb2b8aac3dc9532a0 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width