コード例 #1
0
    def GET(self, post_id):
        if session.user == 'admin':
            post_id = int(post_id)
            post = model.view_post(post_id)
            f = form.post_add_form(post.id, post.name, post.address, post.username, post.password, post.tag)
            return render({'title': settings.SITE_NAME}).edit(f)
        else:
	    return render({'title': settings.SITE_NAME}).notauth()
 def GET(self, post_id):
     post, user = model.view_post(post_id)
     f = form.post_add_form(post_id)
     f.id = post_id
     #t = model.list_comment(post_id)
     t=model.view_comment(post_id)
     #return post_id
     #return render({'title': settings.SITE_NAME, 'make_html': util.make_html}).view(post, user, t, f)
     return render({'title': settings.SITE_NAME, 'make_html': util.make_html},True).viewpost(post, user, t, f)
コード例 #3
0
ファイル: forum.py プロジェクト: Hammer2900/forum
 def GET(self, post_id):
     post, user = model.view_post(post_id)
     f = form.post_add_form(post_id)
     f.id = post_id
     t = model.list_comment(post_id)
     return render({
         'title': settings.SITE_NAME + ' - ' + post.title,
         'make_html': util.make_html
     }).view(post, user, t, f)
コード例 #4
0
 def GET(self, post_id):
     if session.user == 'admin':
         post_id = int(post_id)
         post = model.view_post(post_id)
         f = form.post_add_form(post.id, post.name, post.address,
                                post.username, post.password, post.tag)
         return render({'title': settings.SITE_NAME}).edit(f)
     else:
         return render({'title': settings.SITE_NAME}).notauth()
コード例 #5
0
ファイル: forum.py プロジェクト: seekdoor/forum-1
 def POST(self):
     f = form.post_add_form()
     if not f.validates():
         return render().add(f)
     else:
         post_id = model.new_post(f.d.username, f.d.password, f.d.title, f.d.content)
         if post_id:
             return web.redirect("/view/%d" % post_id)
         else:
             return render().failed()
コード例 #6
0
 def GET(self, post_id):
     post, user = model.view_post(post_id)
     f = form.post_add_form(post_id)
     f.id = post_id
     #t = model.list_comment(post_id)
     t = model.view_comment(post_id)
     #return post_id
     #return render({'title': settings.SITE_NAME, 'make_html': util.make_html}).view(post, user, t, f)
     return render(
         {
             'title': settings.SITE_NAME,
             'make_html': util.make_html
         }, True).viewpost(post, user, t, f)
コード例 #7
0
ファイル: forum.py プロジェクト: seekdoor/forum-1
 def POST(self, post_id):
     post, user = model.view_post(post_id)
     f = form.post_add_form()
     t = model.list_comment(post_id)
     if not f.validates():
         return render({'title': settings.SITE_NAME, 'make_html': util.make_html}).view(post, user, t, f)
     else:
         if f.d.id:
             post_id = model.new_comment(f.d.username, f.d.password, f.d.title, f.d.content, f.d.id)
             if post_id:
                 return web.redirect("/view/%d" % post_id)
             else:
                 return render().failed()
コード例 #8
0
    def POST(self):
        if session.user == 'admin':
            f = form.post_add_form()
            if not f.validates():
                return render({'title': settings.SITE_NAME}).add(f)
            else:
                post_id = model.new_post(f.d.name, f.d.address, f.d.username, f.d.password, f.d.tag)
                if post_id:
                    return web.redirect("/view/%d" % post_id)
                else:
                    return render({'title': settings.SITE_NAME}).failed()
        else:
	    return render({'title': settings.SITE_NAME}).notauth()
コード例 #9
0
 def POST(self):
     if session.user == 'admin':
         f = form.post_add_form()
         if not f.validates():
             return render({'title': settings.SITE_NAME}).add(f)
         else:
             post_id = model.new_post(f.d.name, f.d.address, f.d.username,
                                      f.d.password, f.d.tag)
             if post_id:
                 return web.redirect("/view/%d" % post_id)
             else:
                 return render({'title': settings.SITE_NAME}).failed()
     else:
         return render({'title': settings.SITE_NAME}).notauth()
コード例 #10
0
    def POST(self, post_id):
        if session.user == 'admin':
            post_id = int(post_id)
            post = model.view_post(post_id)
            f = form.post_add_form(post.id, post.name, post.address, post.username, post.password, post.tag)
            if not f.validates():
                return render({'title': settings.SITE_NAME}).edit(f)
            else:
                r = model.edit_post(f)
                if r:
                    return web.redirect("/edit/%d" % post_id)
                else:
                    return render({'title': settings.SITE_NAME}).failed()
        else:
	    return render({'title': settings.SITE_NAME}).notauth()
コード例 #11
0
 def POST(self, post_id):
     if session.user == 'admin':
         post_id = int(post_id)
         post = model.view_post(post_id)
         f = form.post_add_form(post.id, post.name, post.address,
                                post.username, post.password, post.tag)
         if not f.validates():
             return render({'title': settings.SITE_NAME}).edit(f)
         else:
             r = model.edit_post(f)
             if r:
                 return web.redirect("/edit/%d" % post_id)
             else:
                 return render({'title': settings.SITE_NAME}).failed()
     else:
         return render({'title': settings.SITE_NAME}).notauth()
コード例 #12
0
 def GET(self):
     f = form.post_add_form()
     return render({'title': settings.SITE_NAME}).add(f)
コード例 #13
0
 def GET(self):
     if session.user == 'admin':
         f = form.post_add_form()
         return render({'title': settings.SITE_NAME}).add(f)
     else:
         return render({'title': settings.SITE_NAME}).notauth()
コード例 #14
0
    def GET(self):
        if session.user == 'admin':
            f = form.post_add_form()
            return render({'title': settings.SITE_NAME}).add(f)
        else:
	    return render({'title': settings.SITE_NAME}).notauth()
コード例 #15
0
ファイル: forum.py プロジェクト: QiaoHaiZhong/forum
 def GET(self, post_id):
     post, user = model.view_post(post_id)
     f = form.post_add_form(post_id)
     f.id = post_id
     t = model.list_comment(post_id)
     return render({'title': settings.SITE_NAME + ' - ' + post.title, 'make_html': util.make_html}).view(post, user, t, f)
コード例 #16
0
ファイル: forum.py プロジェクト: seekdoor/forum-1
 def GET(self):
     f = form.post_add_form()
     return render().add(f)
コード例 #17
0
 def GET(self):
     f = form.post_add_form()
     return render({'title': settings.SITE_NAME}).add(f)