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)
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)
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()
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)
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()
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()
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()
def GET(self): f = form.post_add_form() return render({'title': settings.SITE_NAME}).add(f)
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()
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)
def GET(self): f = form.post_add_form() return render().add(f)