def post(self): getname = self.request.get("name") getemail = self.request.get("email") gettext = self.request.get("text") if not getname: getname = "Anonymous" entry = GBEntry(name=getname, email=getemail, text=gettext) entry.put() entries = GBEntry.query().fetch() params = {"entries": entries} return self.render_template("guestbook.html", params=params)
def post(self, dbobject_id): getnewname = self.request.get("newname") getnewtext = self.request.get("newtext") entry = GBEntry.get_by_id(int(dbobject_id)) entry.name = getnewname entry.text = getnewtext entry.put() return self.redirect_to("guestbook-home")
def post(self, dbobject_id): entry = GBEntry.get_by_id(int(dbobject_id)) entry.visible = True entry.put() return self.redirect_to("guestbook-home")
def get(self, dbobject_id): entry = GBEntry.get_by_id(int(dbobject_id)) params = {"entry": entry} return self.render_template("guestbook_visible.html", params=params)
def post(self, dbobject_id): entry = GBEntry.get_by_id(int(dbobject_id)) entry.key.delete() return self.redirect_to("guestbook-home")
def get(self): #entries = GBEntry.query(GBEntry.visible == True).fetch() entries = GBEntry.query().fetch() params = {"entries": entries} return self.render_template("guestbook.html", params=params)