File tree Expand file tree Collapse file tree 2 files changed +9
-6
lines changed
Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Original file line number Diff line number Diff line change 1616
1717You'll typically use these to get started with the API:
1818
19- >>> from gcloud import datastore
20- >>> dataset = datastore.get_dataset('dataset-id-here')
21- >>> # Then do other things...
22- >>> query = dataset.query().kind('EntityKind')
23- >>> entity = dataset.entity('EntityKind')
19+ >>> from gcloud.datastore.entity import Entity
20+ >>> from gcloud.datastore.key import Key
21+ >>> from gcloud.datastore.query import Query
22+ >>> key = Key('EntityKind', 1234)
23+ >>> entity = Entity(key)
24+ >>> query = Query('your-dataset-id', kind='EntityKind')
2425
2526The main concepts with this API are:
2627
Original file line number Diff line number Diff line change @@ -40,11 +40,13 @@ class Test_set_default_dataset(unittest2.TestCase):
4040 def setUp (self ):
4141 from gcloud .datastore import _implicit_environ
4242 self ._replaced_dataset = _implicit_environ .DATASET
43- _implicit_environ .DATASET = None
43+ self ._replaced_dataset_id = _implicit_environ .DATASET_ID
44+ _implicit_environ .DATASET = _implicit_environ .DATASET_ID = None
4445
4546 def tearDown (self ):
4647 from gcloud .datastore import _implicit_environ
4748 _implicit_environ .DATASET = self ._replaced_dataset
49+ _implicit_environ .DATASET_ID = self ._replaced_dataset_id
4850
4951 def _callFUT (self , dataset_id = None ):
5052 from gcloud .datastore import set_default_dataset
You can’t perform that action at this time.
0 commit comments