def post(self, url):
        content = self.request.get("content")

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

        time.sleep(0.1)
        self.redirect(url)
    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="/")
    def post(self, post_id):
        content = self.request.get("content")

        entry = Entry.get_by_id(int(post_id))
        entry.content = content
        entry.put()

        self.redirect("/archive/" + post_id)
    def get(self, post_id):

        entry = Entry.get_by_id(int(post_id))

        if entry:
            self.render("archive.html", username=Account.valid_cookie(
                self), entry=entry, url="/archive/" + post_id, subject=entry.subject)
        else:
            self.write("error")
    def get(self, post_id):

        entry = Entry.get_by_id(int(post_id))

        if entry:
            if Account.valid_cookie(self):

                self.render("edit.html", content=entry.content,
                            username=Account.valid_cookie(self))

            else:
                self.redirect("login")
        else:
            self.write("error: requested Archive does not exist")