Skip to content

Commit a8dc223

Browse files
chore(gae): migrate region tags step 1 - at standard/ndb/overview/main.py (GoogleCloudPlatform#13079)
* chore(gae): add requirements-test.txt and requirements-test.txt to pass nox tests * chore(gae): add regions to ndb/overview/main.py
1 parent 5e8e178 commit a8dc223

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

appengine/standard/ndb/overview/main.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
For more information, see README.md
2121
"""
2222

23+
# [START gae_ndb_overview]
2324
# [START all]
2425
import cgi
2526
import textwrap
@@ -30,14 +31,17 @@
3031
import webapp2
3132

3233

34+
# [START gae_ndb_overview_greeting]
3335
# [START greeting]
3436
class Greeting(ndb.Model):
3537
"""Models an individual Guestbook entry with content and date."""
3638

3739
content = ndb.StringProperty()
3840
date = ndb.DateTimeProperty(auto_now_add=True)
3941
# [END greeting]
42+
# [END gae_ndb_overview_greeting]
4043

44+
# [START gae_ndb_overview_query]
4145
# [START query]
4246
@classmethod
4347
def query_book(cls, ancestor_key):
@@ -51,6 +55,7 @@ def get(self):
5155
ancestor_key = ndb.Key("Book", guestbook_name or "*notitle*")
5256
greetings = Greeting.query_book(ancestor_key).fetch(20)
5357
# [END query]
58+
# [END gae_ndb_overview_query]
5459

5560
greeting_blockquotes = []
5661
for greeting in greetings:
@@ -89,6 +94,7 @@ def get(self):
8994
)
9095

9196

97+
# [START gae_ndb_overview_submit]
9298
# [START submit]
9399
class SubmitForm(webapp2.RequestHandler):
94100
def post(self):
@@ -101,8 +107,10 @@ def post(self):
101107
)
102108
greeting.put()
103109
# [END submit]
110+
# [END gae_ndb_overview_submit]
104111
self.redirect("/?" + urllib.urlencode({"guestbook_name": guestbook_name}))
105112

106113

107114
app = webapp2.WSGIApplication([("/", MainPage), ("/sign", SubmitForm)])
108115
# [END all]
116+
# [END gae_ndb_overview]
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# pin pytest to 4.6.11 for Python2.
2+
pytest==4.6.11; python_version < '3.0'
3+
4+
# pytest==8.3.4 and six==1.17.0 for Python3.
5+
pytest==8.3.4; python_version >= '3.0'
6+
six==1.17.0

appengine/standard/ndb/overview/requirements.txt

Whitespace-only changes.

0 commit comments

Comments
 (0)