Exemplo n.º 1
0
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)
Exemplo n.º 2
0
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)
Exemplo n.º 3
0
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,))
Exemplo n.º 4
0
def admincontrol_siteupdate_post_(request):
    form = request.web_input(title="", content="")

    siteupdate.create(request.userid, form)

    raise HTTPSeeOther(location="/admincontrol")