예제 #1
0
 def POST(self):
     ObjectWeb.header("Content-Type", "text/html")
     frm = myform()
     if not frm.validates():
         return "FAILED"
     else:
         return str(frm.email) + " " + str(frm.password)
예제 #2
0
 def POST(self):
     ObjectWeb.header("Content-Type","text/html")
     frm = myform()
     if not frm.validates():
         return "FAILED"
     else:
         return str(frm.email) + " " + str(frm.password)
예제 #3
0
 def GET(self, name):
     ObjectWeb.header("Content-Type", "text/plain")
     
     age = ObjectWeb.get("age", None)
     
     if age:
         return "Hello "+str(name)+", you are "+str(age)+" years old."
     else:
         return "Hello "+str(name)+"!"
예제 #4
0
    def GET(self, name):
        ObjectWeb.header("Content-Type", "text/plain")

        age = ObjectWeb.get("age", None)

        if age:
            return "Hello " + str(name) + ", you are " + str(
                age) + " years old."
        else:
            return "Hello " + str(name) + "!"
예제 #5
0
    def POST(self):
        ObjectWeb.header("Content-Type", "text/html")
        form = NewPostForm()

        if form.validates():
            blogrec.set_post(
                blogrec.BlogPost(str(form.title), str(form.content)))
            ObjectWeb.seeother("/")
            return ""
        else:
            return blogrec.display(form.render())
예제 #6
0
파일: index.py 프로젝트: aisola/ObjectWeb
 def POST(self):
     ObjectWeb.header("Content-Type", "text/html")
     form = NewPostForm()
     
     if form.validates():
         blogrec.set_post(
             blogrec.BlogPost(str(form.title), str(form.content))
         )
         ObjectWeb.seeother("/")
         return ""
     else:
         return blogrec.display(form.render())
예제 #7
0
    def GET(self):
        ObjectWeb.header("Content-Type", "text/html")

        posts = blogrec.get_posts()

        if posts:
            content = ""
            for post in posts:
                content += "<div class='post' style='border: 1px solid #000;'>"
                content += "<h3>" + str(post.title) + "</h3>"
                content += "<section>%s</section>" % post.content
                content += "</div>"
        else:
            content = "<div>There are no posts.</div>"

        return blogrec.display(content)
예제 #8
0
파일: index.py 프로젝트: aisola/ObjectWeb
    def GET(self):
        ObjectWeb.header("Content-Type", "text/html")
        
        posts = blogrec.get_posts()

        if posts:
            content = ""
            for post in posts:
                content += "<div class='post' style='border: 1px solid #000;'>"
                content += "<h3>"+str(post.title)+"</h3>"
                content += "<section>%s</section>" % post.content
                content += "</div>"
        else:
            content = "<div>There are no posts.</div>"
                
        return blogrec.display(content)
예제 #9
0
 def GET (self):
     ObjectWeb.header("Content-Type","text/html")
     frm = myform()
     return frm.render()
예제 #10
0
 def GET(self):
     ObjectWeb.header("Content-Type", "text/html")
     frm = myform()
     return frm.render()
예제 #11
0
    def GET(self):
        ObjectWeb.header("Content-Type", "text/html")

        form = NewPostForm()
        return blogrec.display(form.render())
예제 #12
0
    def GET(self):
        ObjectWeb.status("404 Not Found")
        ObjectWeb.header("Content-Type", "text/plain")

        return "404 Not Found"
예제 #13
0
    def GET(self):
        # ObjectWeb.status("200 OK")
        ObjectWeb.header("Content-Type", "text/plain")

        return "Hello World!"
예제 #14
0
 def GET(self):
     ObjectWeb.header("Content-Type", "text/plain")
     ObjectWeb.header("X-Powered-By", "ObjectWeb/2.0")
     return str(ObjectWeb.context)
예제 #15
0
 def GET(self):
     # ObjectWeb.status("200 OK")
     ObjectWeb.header("Content-Type", "text/plain")
     
     return "Hello World!"
예제 #16
0
파일: index.py 프로젝트: aisola/ObjectWeb
 def GET(self):
     ObjectWeb.header("Content-Type", "text/html")
     
     form = NewPostForm()
     return blogrec.display(form.render())
예제 #17
0
 def GET(self):
     ObjectWeb.status("404 Not Found")
     ObjectWeb.header("Content-Type", "text/plain")
     
     return "404 Not Found"