@@ -62,7 +62,7 @@ def basic_entity(client):
62
62
# [START basic_entity]
63
63
task = datastore .Entity (client .key ('Task' ))
64
64
task .update ({
65
- 'type ' : 'Personal' ,
65
+ 'category ' : 'Personal' ,
66
66
'done' : False ,
67
67
'priority' : 4 ,
68
68
'description' : 'Learn Cloud Datastore'
@@ -80,7 +80,7 @@ def entity_with_parent(client):
80
80
task = datastore .Entity (key = key_with_parent )
81
81
82
82
task .update ({
83
- 'type ' : 'Personal' ,
83
+ 'category ' : 'Personal' ,
84
84
'done' : False ,
85
85
'priority' : 4 ,
86
86
'description' : 'Learn Cloud Datastore'
@@ -97,7 +97,7 @@ def properties(client):
97
97
key ,
98
98
exclude_from_indexes = ['description' ])
99
99
task .update ({
100
- 'type ' : 'Personal' ,
100
+ 'category ' : 'Personal' ,
101
101
'description' : 'Learn Cloud Datastore' ,
102
102
'created' : datetime .datetime .utcnow (),
103
103
'done' : False ,
@@ -135,7 +135,7 @@ def upsert(client):
135
135
task = datastore .Entity (key = complete_key )
136
136
137
137
task .update ({
138
- 'type ' : 'Personal' ,
138
+ 'category ' : 'Personal' ,
139
139
'done' : False ,
140
140
'priority' : 4 ,
141
141
'description' : 'Learn Cloud Datastore'
@@ -155,7 +155,7 @@ def insert(client):
155
155
task = datastore .Entity (key = incomplete_key )
156
156
157
157
task .update ({
158
- 'type ' : 'Personal' ,
158
+ 'category ' : 'Personal' ,
159
159
'done' : False ,
160
160
'priority' : 4 ,
161
161
'description' : 'Learn Cloud Datastore'
@@ -212,7 +212,7 @@ def batch_upsert(client):
212
212
task1 = datastore .Entity (client .key ('Task' , 1 ))
213
213
214
214
task1 .update ({
215
- 'type ' : 'Personal' ,
215
+ 'category ' : 'Personal' ,
216
216
'done' : False ,
217
217
'priority' : 4 ,
218
218
'description' : 'Learn Cloud Datastore'
@@ -221,7 +221,7 @@ def batch_upsert(client):
221
221
task2 = datastore .Entity (client .key ('Task' , 2 ))
222
222
223
223
task2 .update ({
224
- 'type ' : 'Work' ,
224
+ 'category ' : 'Work' ,
225
225
'done' : False ,
226
226
'priority' : 8 ,
227
227
'description' : 'Integrate Cloud Datastore'
@@ -296,7 +296,7 @@ def projection_query(client):
296
296
# Create the entity that we're going to query.
297
297
task = datastore .Entity (client .key ('Task' ))
298
298
task .update ({
299
- 'type ' : 'Personal' ,
299
+ 'category ' : 'Personal' ,
300
300
'done' : False ,
301
301
'priority' : 4 ,
302
302
'description' : 'Learn Cloud Datastore' ,
@@ -325,7 +325,7 @@ def ancestor_query(client):
325
325
task = datastore .Entity (
326
326
client .key ('TaskList' , 'default' , 'Task' ))
327
327
task .update ({
328
- 'type ' : 'Personal' ,
328
+ 'category ' : 'Personal' ,
329
329
'description' : 'Learn Cloud Datastore' ,
330
330
})
331
331
client .put (task )
@@ -477,9 +477,9 @@ def distinct_query(client):
477
477
478
478
# [START distinct_query]
479
479
query = client .query (kind = 'Task' )
480
- query .distinct_on = ['type ' , 'priority' ]
481
- query .order = ['type ' , 'priority' ]
482
- query .projection = ['type ' , 'priority' ]
480
+ query .distinct_on = ['category ' , 'priority' ]
481
+ query .order = ['category ' , 'priority' ]
482
+ query .projection = ['category ' , 'priority' ]
483
483
# [END distinct_query]
484
484
485
485
return list (query .fetch ())
@@ -491,8 +491,8 @@ def distinct_on_query(client):
491
491
492
492
# [START distinct_on_query]
493
493
query = client .query (kind = 'Task' )
494
- query .distinct_on = ['type ' ]
495
- query .order = ['type ' , 'priority' ]
494
+ query .distinct_on = ['category ' ]
495
+ query .order = ['category ' , 'priority' ]
496
496
# [END distinct_on_query]
497
497
498
498
return list (query .fetch ())
0 commit comments