Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

chore(gae): delete regions from migration/ndb/overview/main.py #13078

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions 7 appengine/standard/migration/ndb/overview/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,6 @@ with the [Google Cloud NDB library](https://googleapis.dev/python/python-ndb/lat
This library can be used not only on App Engine, but also other Python 3
platforms.

To deploy and run this sample in App Engine standard for Python 2.7:

pip install -t lib -r requirements.txt
gcloud app deploy

To deploy and run this sample in App Engine standard for Python 3.7:
To deploy and run this sample in App Engine standard for Python 3.8:
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

low

Since the code now targets Python 3.8, the README should specify Python 3.8 or later. Per the Authoring Guide, supporting a range of Python versions is preferred.

Suggested change
To deploy and run this sample in App Engine standard for Python 3.8:
To deploy and run this sample in App Engine standard for Python 3.8 or later:


gcloud app deploy app3.yaml
8 changes: 0 additions & 8 deletions 8 appengine/standard/migration/ndb/overview/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# [START all]
from flask import Flask, redirect, render_template, request
from google.cloud import ndb

Expand All @@ -25,15 +24,12 @@
client = ndb.Client()


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

content = ndb.StringProperty()
date = ndb.DateTimeProperty(auto_now_add=True)
# [END greeting]

# [START query]
with client.context():

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

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


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

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


if __name__ == "__main__":
# This is used when running locally.
app.run(host="127.0.0.1", port=8080, debug=True)
# [END all]
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
# pin pytest to 4.6.11 for Python2.
pytest==4.6.11; python_version < '3.0'

# pytest==8.3.4 and six==1.17.0 for Python3.
pytest==8.3.4; python_version >= '3.0'
six==1.17.0
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@
<input type="submit" value="switch" />
</form>
</body>
</html >
</html>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

low

The HTML file is missing a doctype declaration. Adding <!DOCTYPE html> as the first line will help ensure that the page renders consistently across different browsers. Reference commonly used style guides, such as the W3C HTML validator.

<!DOCTYPE html>
<html>

Morty Proxy This is a proxified and sanitized view of the page, visit original site.