File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed
Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -23,17 +23,21 @@ def run_quickstart():
2323 # Instantiates a client
2424 datastore_client = datastore .Client ()
2525
26- # The kind of the entity to retrieve
26+ # The kind for the new entity
2727 kind = 'Task'
28- # The name/ID of the entity to retrieve
28+ # The name/ID for the new entity
2929 name = 'sampletask1'
30- # The Datastore key for the entity
30+ # The Cloud Datastore key for the new entity
3131 task_key = datastore_client .key (kind , name )
3232
33- # Retrieves the entity
34- task = datastore_client .get (task_key )
33+ # Prepares the new entity
34+ task = datastore .Entity (key = task_key )
35+ task ['description' ] = 'Buy milk'
3536
36- print ('Fetched task: {}' .format (task .key .name ))
37+ # Saves the entity
38+ datastore_client .put (task )
39+
40+ print ('Saved {}: {}' .format (task .key .name , task ['description' ]))
3741 # [END datastore_quickstart]
3842
3943
You can’t perform that action at this time.
0 commit comments