Skip to content

Commit 72e5823

Browse files
committed
Move example docstring from connection.py->client.py
1 parent 0d0497a commit 72e5823

2 files changed

Lines changed: 6 additions & 23 deletions

File tree

gcloud/datastore/client.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -462,6 +462,11 @@ def query(self, **kwargs):
462462
>>> cursor
463463
<string containing cursor where fetch stopped>
464464
465+
Under the hood this is doing:
466+
467+
>>> connection.run_query('project', query.to_protobuf())
468+
[<list of Entity Protobufs>], cursor, more_results, skipped_results
469+
465470
:type **kwargs: dict
466471
:param **kwargs: Parameters for initializing and instance of
467472
:class:`gcloud.datastore.query.Query`.

gcloud/datastore/connection.py

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -227,29 +227,7 @@ def run_query(self, project, query_pb, namespace=None,
227227
:meth:`gcloud.datastore.query.Query.fetch` method.
228228
229229
Under the hood, the :class:`gcloud.datastore.query.Query` class
230-
uses this method to fetch data:
231-
232-
>>> from gcloud import datastore
233-
>>> client = datastore.Client()
234-
>>> query = client.query(kind='MyKind')
235-
>>> query.add_filter('property', '=', 'val')
236-
237-
Using the query iterator's
238-
:meth:`next_page() <.datastore.query.Iterator.next_page>` method:
239-
240-
>>> query_iter = query.fetch()
241-
>>> entities, more_results, cursor = query_iter.next_page()
242-
>>> entities
243-
[<list of Entity unmarshalled from protobuf>]
244-
>>> more_results
245-
<boolean of more results>
246-
>>> cursor
247-
<string containing cursor where fetch stopped>
248-
249-
Under the hood this is doing:
250-
251-
>>> connection.run_query('project', query.to_protobuf())
252-
[<list of Entity Protobufs>], cursor, more_results, skipped_results
230+
uses this method to fetch data.
253231
254232
:type project: string
255233
:param project: The project over which to run the query.

0 commit comments

Comments
 (0)