From 9101b262a40837cfd0ccd49e7b34d928311225c2 Mon Sep 17 00:00:00 2001 From: Thomas Schultz <daspecster@gmail.com> Date: Tue, 2 Aug 2016 16:58:41 -0400 Subject: [PATCH] Move example docstring from connection.py->client.py --- gcloud/datastore/client.py | 5 +++++ gcloud/datastore/connection.py | 24 +----------------------- 2 files changed, 6 insertions(+), 23 deletions(-) diff --git a/gcloud/datastore/client.py b/gcloud/datastore/client.py index 6416d0a931fc8..75aeb61b90b6e 100644 --- a/gcloud/datastore/client.py +++ b/gcloud/datastore/client.py @@ -462,6 +462,11 @@ def query(self, **kwargs): >>> cursor <string containing cursor where fetch stopped> + Under the hood this is doing: + + >>> connection.run_query('project', query.to_protobuf()) + [<list of Entity Protobufs>], cursor, more_results, skipped_results + :type **kwargs: dict :param **kwargs: Parameters for initializing and instance of :class:`gcloud.datastore.query.Query`. diff --git a/gcloud/datastore/connection.py b/gcloud/datastore/connection.py index de030bc044709..bc17db928013e 100644 --- a/gcloud/datastore/connection.py +++ b/gcloud/datastore/connection.py @@ -227,29 +227,7 @@ def run_query(self, project, query_pb, namespace=None, :meth:`gcloud.datastore.query.Query.fetch` method. Under the hood, the :class:`gcloud.datastore.query.Query` class - uses this method to fetch data: - - >>> from gcloud import datastore - >>> client = datastore.Client() - >>> query = client.query(kind='MyKind') - >>> query.add_filter('property', '=', 'val') - - Using the query iterator's - :meth:`next_page() <.datastore.query.Iterator.next_page>` method: - - >>> query_iter = query.fetch() - >>> entities, more_results, cursor = query_iter.next_page() - >>> entities - [<list of Entity unmarshalled from protobuf>] - >>> more_results - <boolean of more results> - >>> cursor - <string containing cursor where fetch stopped> - - Under the hood this is doing: - - >>> connection.run_query('project', query.to_protobuf()) - [<list of Entity Protobufs>], cursor, more_results, skipped_results + uses this method to fetch data. :type project: string :param project: The project over which to run the query.