Skip to content

Commit d276537

Browse files
chore(gae): delete regions from migration/ndb/overview/main.py (#13078)
* chore(gae): delete regions from migration/ndb/overview/main.py * chore(gae): add support for Python 3 to requirements-test.txt * chore(gae): fix whitespace in templates/index.html * docs(gae): update README.md to a current Python 3 sample
1 parent a8dc223 commit d276537

File tree

4 files changed

+6
-15
lines changed

4 files changed

+6
-15
lines changed

appengine/standard/migration/ndb/overview/README.md

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,6 @@ with the [Google Cloud NDB library](https://googleapis.dev/python/python-ndb/lat
1111
This library can be used not only on App Engine, but also other Python 3
1212
platforms.
1313

14-
To deploy and run this sample in App Engine standard for Python 2.7:
15-
16-
pip install -t lib -r requirements.txt
17-
gcloud app deploy
18-
19-
To deploy and run this sample in App Engine standard for Python 3.7:
14+
To deploy and run this sample in App Engine standard for Python 3.8:
2015

2116
gcloud app deploy app3.yaml

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

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

15-
# [START all]
1615
from flask import Flask, redirect, render_template, request
1716
from google.cloud import ndb
1817

@@ -25,15 +24,12 @@
2524
client = ndb.Client()
2625

2726

28-
# [START greeting]
2927
class Greeting(ndb.Model):
3028
"""Models an individual Guestbook entry with content and date."""
3129

3230
content = ndb.StringProperty()
3331
date = ndb.DateTimeProperty(auto_now_add=True)
34-
# [END greeting]
3532

36-
# [START query]
3733
with client.context():
3834

3935
@classmethod
@@ -48,7 +44,6 @@ def display_guestbook():
4844
with client.context():
4945
ancestor_key = ndb.Key("Book", guestbook_name or "*notitle*")
5046
greetings = Greeting.query_book(ancestor_key).fetch(20)
51-
# [END query]
5247

5348
greeting_blockquotes = [greeting.content for greeting in greetings]
5449
return render_template(
@@ -58,7 +53,6 @@ def display_guestbook():
5853
)
5954

6055

61-
# [START submit]
6256
@app.route("/sign", methods=["POST"])
6357
def update_guestbook():
6458
# We set the parent key on each 'Greeting' to ensure each guestbook's
@@ -73,12 +67,10 @@ def update_guestbook():
7367
content=request.form.get("content", None),
7468
)
7569
greeting.put()
76-
# [END submit]
7770

7871
return redirect("/?" + urlencode({"guestbook_name": guestbook_name}))
7972

8073

8174
if __name__ == "__main__":
8275
# This is used when running locally.
8376
app.run(host="127.0.0.1", port=8080, debug=True)
84-
# [END all]
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
11
# pin pytest to 4.6.11 for Python2.
22
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/migration/ndb/overview/templates/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,4 @@
4343
<input type="submit" value="switch" />
4444
</form>
4545
</body>
46-
</html >
46+
</html>

0 commit comments

Comments
 (0)