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():
23
23
# Instantiates a client
24
24
datastore_client = datastore .Client ()
25
25
26
- # The kind of the entity to retrieve
26
+ # The kind for the new entity
27
27
kind = 'Task'
28
- # The name/ID of the entity to retrieve
28
+ # The name/ID for the new entity
29
29
name = 'sampletask1'
30
- # The Datastore key for the entity
30
+ # The Cloud Datastore key for the new entity
31
31
task_key = datastore_client .key (kind , name )
32
32
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'
35
36
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' ]))
37
41
# [END datastore_quickstart]
38
42
39
43
You can’t perform that action at this time.
0 commit comments