File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
Filter options
appengine/standard/ndb/schema_update Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
Original file line number Diff line number Diff line change 20
20
populate these new fields onto entities that existed prior to adding the
21
21
new fields to the model class.
22
22
"""
23
-
23
+ # [START imports]
24
24
import logging
25
25
import os
26
26
38
38
os .path .join (os .path .dirname (__file__ ), 'templates' )),
39
39
extensions = ['jinja2.ext.autoescape' ],
40
40
autoescape = True )
41
+ # [END imports]
41
42
42
43
44
+ # [START display_entities]
43
45
class DisplayEntitiesHandler (webapp2 .RequestHandler ):
44
46
"""Displays the current set of entities and options to add entities
45
47
or update the schema."""
@@ -54,8 +56,10 @@ def get(self):
54
56
55
57
template = JINJA_ENVIRONMENT .get_template ('index.html' )
56
58
self .response .write (template .render (template_values ))
59
+ # [END display_entities]
57
60
58
61
62
+ # [START add_entities]
59
63
class AddEntitiesHandler (webapp2 .RequestHandler ):
60
64
"""Adds new entities using the v1 schema."""
61
65
def post (self ):
@@ -71,8 +75,10 @@ def post(self):
71
75
self .response .write ("""
72
76
Entities created. <a href="/">View entities</a>.
73
77
""" )
78
+ # [END add_entities]
74
79
75
80
81
+ # [START update_schema]
76
82
class UpdateSchemaHandler (webapp2 .RequestHandler ):
77
83
"""Queues a task to start updating the model schema."""
78
84
def post (self ):
@@ -123,6 +129,7 @@ def update_schema_task(cursor=None, num_updated=0, batch_size=100):
123
129
logging .debug (
124
130
'update_schema_task complete with {0} updates!' .format (
125
131
num_updated ))
132
+ # [END update_schema]
126
133
127
134
128
135
app = webapp2 .WSGIApplication ([
You can’t perform that action at this time.
0 commit comments