diff --git a/gcloud/datastore/__init__.py b/gcloud/datastore/__init__.py index f3f6325ea73c..12a02e4ebc38 100644 --- a/gcloud/datastore/__init__.py +++ b/gcloud/datastore/__init__.py @@ -20,10 +20,10 @@ >>> from gcloud.datastore.entity import Entity >>> from gcloud.datastore.key import Key >>> from gcloud.datastore.query import Query ->>> + >>> datastore.set_default_connection() >>> datastore.set_default_dataset_id() ->>> + >>> key = Key('EntityKind', 1234) >>> entity = Entity(key) >>> query = Query(kind='EntityKind') @@ -102,7 +102,7 @@ def get_connection(): >>> from gcloud import datastore >>> from gcloud.datastore import Key - >>> + >>> connection = datastore.get_connection() >>> key1 = Key('Kind', 1234, dataset_id='dataset1') >>> key2 = Key('Kind', 1234, dataset_id='dataset2') diff --git a/gcloud/datastore/connection.py b/gcloud/datastore/connection.py index d91dd626b6ef..db0c751482d2 100644 --- a/gcloud/datastore/connection.py +++ b/gcloud/datastore/connection.py @@ -263,10 +263,10 @@ def run_query(self, dataset_id, query_pb, namespace=None, eventual=False): >>> from gcloud import datastore >>> from gcloud.datastore.query import Query - >>> + >>> datastore.set_default_connection() >>> datastore.set_default_dataset_id() - >>> + >>> query = Query(kind='MyKind') >>> query.add_filter('property', '=', 'val') diff --git a/gcloud/datastore/transaction.py b/gcloud/datastore/transaction.py index afe40e32df85..6608fbfa4650 100644 --- a/gcloud/datastore/transaction.py +++ b/gcloud/datastore/transaction.py @@ -30,10 +30,10 @@ class Transaction(object): >>> from gcloud import datastore >>> from gcloud.datastore.transaction import Transaction - >>> + >>> datastore.set_default_connection() >>> datastore.set_default_dataset_id() - >>> + >>> with Transaction() ... entity1.save() ... entity2.save()