Skip to content

Commit

Permalink
chore(gae): delete old regions from ndb/overview/main.py (#13082)
Browse files Browse the repository at this point in the history
  • Loading branch information
eapl-gemugami authored Jan 21, 2025
1 parent 24245db commit fa178a9
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions appengine/standard/ndb/overview/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
"""

# [START gae_ndb_overview]
# [START all]
import cgi
import textwrap
import urllib
Expand All @@ -32,17 +31,14 @@


# [START gae_ndb_overview_greeting]
# [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]
# [END gae_ndb_overview_greeting]

# [START gae_ndb_overview_query]
# [START query]
@classmethod
def query_book(cls, ancestor_key):
return cls.query(ancestor=ancestor_key).order(-cls.date)
Expand All @@ -54,7 +50,6 @@ def get(self):
guestbook_name = self.request.get("guestbook_name")
ancestor_key = ndb.Key("Book", guestbook_name or "*notitle*")
greetings = Greeting.query_book(ancestor_key).fetch(20)
# [END query]
# [END gae_ndb_overview_query]

greeting_blockquotes = []
Expand Down Expand Up @@ -95,7 +90,6 @@ def get(self):


# [START gae_ndb_overview_submit]
# [START submit]
class SubmitForm(webapp2.RequestHandler):
def post(self):
# We set the parent key on each 'Greeting' to ensure each guestbook's
Expand All @@ -106,11 +100,9 @@ def post(self):
content=self.request.get("content"),
)
greeting.put()
# [END submit]
# [END gae_ndb_overview_submit]
self.redirect("/?" + urllib.urlencode({"guestbook_name": guestbook_name}))


app = webapp2.WSGIApplication([("/", MainPage), ("/sign", SubmitForm)])
# [END all]
# [END gae_ndb_overview]

0 comments on commit fa178a9

Please sign in to comment.