def _site_updates(): user = db_utils.create_user(username='******') updates = [ siteupdate.create(user, u'foo', u'content one'), siteupdate.create(user, u'bar', u'content two'), siteupdate.create(user, u'baz', u'content three'), ] for update in updates: sessionmaker().expunge(update) return (user, updates)
def admincontrol_siteupdate_post_(request): title = request.params["title"].strip() content = request.params["content"].strip() if not title: raise WeasylError("titleInvalid") if not content: raise WeasylError("contentInvalid") update = siteupdate.create(request.userid, title, content) raise HTTPSeeOther(location="/site-updates/%d" % (update.updateid,))
def admincontrol_siteupdate_post_(request): form = request.web_input(title="", content="") siteupdate.create(request.userid, form) raise HTTPSeeOther(location="/admincontrol")