Skip to content

Commit f25f1bf

Browse files
chore(gae): rename regions in migration/ndb/redis_cache/main.py (#13054)
* chore(gae): rename regions in ndb/redis_cache/main.py * chore(gae): add support for Python 3 to requirements-test.txt
1 parent d618a0c commit f25f1bf

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

appengine/standard/migration/ndb/redis_cache/main.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
# [START all]
15+
# [START gae_ndb_redis_cache]
1616
import logging
1717

1818
from flask import Flask, redirect, render_template, request
@@ -33,15 +33,15 @@
3333
global_cache = None
3434

3535

36-
# [START greeting]
36+
# [START gae_ndb_redis_cache_greeting]
3737
class Greeting(ndb.Model):
3838
"""Models an individual Guestbook entry with content and date."""
3939

4040
content = ndb.StringProperty()
4141
date = ndb.DateTimeProperty(auto_now_add=True)
42-
# [END greeting]
42+
# [END gae_ndb_redis_cache_greeting]
4343

44-
# [START query]
44+
# [START gae_ndb_redis_cache_query]
4545
with client.context(global_cache=global_cache):
4646

4747
@classmethod
@@ -56,7 +56,7 @@ def display_guestbook():
5656
with client.context(global_cache=global_cache):
5757
ancestor_key = ndb.Key("Book", guestbook_name or "*notitle*")
5858
greetings = Greeting.query_book(ancestor_key).fetch(20)
59-
# [END query]
59+
# [END gae_ndb_redis_cache_query]
6060

6161
greeting_blockquotes = [greeting.content for greeting in greetings]
6262
return render_template(
@@ -66,7 +66,7 @@ def display_guestbook():
6666
)
6767

6868

69-
# [START submit]
69+
# [START gae_ndb_redis_cache_submit]
7070
@app.route("/sign", methods=["POST"])
7171
def update_guestbook():
7272
# We set the parent key on each 'Greeting' to ensure each guestbook's
@@ -81,12 +81,12 @@ def update_guestbook():
8181
content=request.form.get("content", None),
8282
)
8383
greeting.put()
84-
# [END submit]
84+
# [END gae_ndb_redis_cache_submit]
8585

8686
return redirect("/?" + urlencode({"guestbook_name": guestbook_name}))
8787

8888

8989
if __name__ == "__main__":
9090
# This is used when running locally.
9191
app.run(host="127.0.0.1", port=8080, debug=True)
92-
# [END all]
92+
# [END gae_ndb_redis_cache]
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,7 @@
11
# pin pytest to 4.6.11 for Python2.
22
pytest==4.6.11; python_version < '3.0'
3+
4+
# 2025-01-14 Adds support for Python3.
5+
pytest==8.3.2; python_version >= '3.0'
6+
WebTest==3.0.1; python_version >= '3.0'
7+
six==1.16.0

0 commit comments

Comments
 (0)