Exemplo n.º 1
0
    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)
Exemplo n.º 2
0
 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")
Exemplo n.º 3
0
 def post(self, dbobject_id):
     entry = GBEntry.get_by_id(int(dbobject_id))
     entry.visible = True
     entry.put()
     return self.redirect_to("guestbook-home")
Exemplo n.º 4
0
 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)
Exemplo n.º 5
0
 def post(self, dbobject_id):
     entry = GBEntry.get_by_id(int(dbobject_id))
     entry.key.delete()
     return self.redirect_to("guestbook-home")
Exemplo n.º 6
0
 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)