From 1e915dad6f9eb8189659348d9db0d46b91085d0e Mon Sep 17 00:00:00 2001 From: Tres Seaver Date: Wed, 7 Jan 2015 11:46:34 -0500 Subject: [PATCH 1/2] Remove mention of dataset factory methods. --- gcloud/datastore/__init__.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/gcloud/datastore/__init__.py b/gcloud/datastore/__init__.py index 3acb3e956bae..5033aec06b63 100644 --- a/gcloud/datastore/__init__.py +++ b/gcloud/datastore/__init__.py @@ -16,11 +16,12 @@ You'll typically use these to get started with the API: ->>> from gcloud import datastore ->>> dataset = datastore.get_dataset('dataset-id-here') ->>> # Then do other things... ->>> query = dataset.query().kind('EntityKind') ->>> entity = dataset.entity('EntityKind') +>>> from gcloud.datastore.entity import Entity +>>> from gcloud.datastore.key import Key +>>> from gcloud.datastore.query import Query +>>> key = Key('EntityKind', 1234) +>>> entity = Entity(key) +>>> query = Query('your-dataset-id', kind='EntityKind') The main concepts with this API are: From 5571485a5920a645ef61e12f1a0b4d4e9dc2c2ff Mon Sep 17 00:00:00 2001 From: Tres Seaver Date: Wed, 7 Jan 2015 11:47:17 -0500 Subject: [PATCH 2/2] Fix cleanup after #493. --- gcloud/datastore/test___init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gcloud/datastore/test___init__.py b/gcloud/datastore/test___init__.py index 4280134134d3..2146d8fdc2f9 100644 --- a/gcloud/datastore/test___init__.py +++ b/gcloud/datastore/test___init__.py @@ -40,11 +40,13 @@ class Test_set_default_dataset(unittest2.TestCase): def setUp(self): from gcloud.datastore import _implicit_environ self._replaced_dataset = _implicit_environ.DATASET - _implicit_environ.DATASET = None + self._replaced_dataset_id = _implicit_environ.DATASET_ID + _implicit_environ.DATASET = _implicit_environ.DATASET_ID = None def tearDown(self): from gcloud.datastore import _implicit_environ _implicit_environ.DATASET = self._replaced_dataset + _implicit_environ.DATASET_ID = self._replaced_dataset_id def _callFUT(self, dataset_id=None): from gcloud.datastore import set_default_dataset