コード例 #1
0
    def post(self, url):
        content = self.request.get("content")

        entry = Entry(subject=url, content=content)
        entry.put()

        time.sleep(0.1)
        self.redirect(url)
コード例 #2
0
    def get(self):
        entry = db.GqlQuery(
            "select * from Entry where subject='/' order by created desc").get()

        if entry:
            front_content = entry.content
        else:

            front_content = "<h1>Welcome to the Final!!!</h1>"
            entry = Entry(subject="/", content=front_content)
            entry.put()

        self.render("front.html", username=Account.valid_cookie(
            self), front_content=front_content, url="/")