示例#1
0
文件: content.py 项目: weykent/weasyl
    def POST(self):
        form = web.input(charid="",
                         title="",
                         age="",
                         gender="",
                         height="",
                         weight="",
                         species="",
                         rating="",
                         content="",
                         friends="")

        rating = ratings.CODE_MAP.get(define.get_int(form.rating))
        if not rating:
            raise WeasylError("ratingInvalid")

        c = orm.Character()
        c.charid = define.get_int(form.charid)
        c.age = form.age
        c.gender = form.gender
        c.height = form.height
        c.weight = form.weight
        c.species = form.species
        c.char_name = form.title
        c.content = form.content
        c.rating = rating

        character.edit(self.user_id, c, friends_only=form.friends)
        raise web.seeother(
            "/character/%i/%s%s" %
            (define.get_int(form.charid), slug_for(form.title),
             ("?anyway=true" if self.user_id in staff.MODS else '')))
示例#2
0
def edit_character_post_(request):
    form = request.web_input(charid="",
                             title="",
                             age="",
                             gender="",
                             height="",
                             weight="",
                             species="",
                             rating="",
                             content="",
                             friends="")

    rating = ratings.CODE_MAP.get(define.get_int(form.rating))
    if not rating:
        raise WeasylError("ratingInvalid")

    c = orm.Character()
    c.charid = define.get_int(form.charid)
    c.age = form.age
    c.gender = form.gender
    c.height = form.height
    c.weight = form.weight
    c.species = form.species
    c.char_name = form.title
    c.content = form.content
    c.rating = rating

    character.edit(request.userid, c, friends_only=form.friends)
    raise HTTPSeeOther(
        location="/character/%i/%s%s" %
        (define.get_int(form.charid), slug_for(form.title),
         ("?anyway=true" if request.userid in staff.MODS else '')))
示例#3
0
文件: content.py 项目: makyo/weasyl
def edit_character_post_(request):
    form = request.web_input(charid="", title="", age="", gender="", height="",
                             weight="", species="", rating="", content="", friends="")

    rating = ratings.CODE_MAP.get(define.get_int(form.rating))
    if not rating:
        raise WeasylError("ratingInvalid")

    c = orm.Character()
    c.charid = define.get_int(form.charid)
    c.age = form.age
    c.gender = form.gender
    c.height = form.height
    c.weight = form.weight
    c.species = form.species
    c.char_name = form.title
    c.content = form.content
    c.rating = rating

    character.edit(request.userid, c, friends_only=form.friends)
    raise HTTPSeeOther(location="/character/%i/%s%s" % (
        define.get_int(form.charid),
        slug_for(form.title),
        ("?anyway=true" if request.userid in staff.MODS else '')
    ))
示例#4
0
文件: content.py 项目: 0x15/weasyl
    def POST(self):
        form = web.input(charid="", title="", age="", gender="", height="",
                         weight="", species="", rating="", content="", friends="")

        rating = ratings.CODE_MAP.get(define.get_int(form.rating))
        if not rating:
            raise WeasylError("ratingInvalid")

        c = orm.Character()
        c.charid = define.get_int(form.charid)
        c.age = form.age
        c.gender = form.gender
        c.height = form.height
        c.weight = form.weight
        c.species = form.species
        c.char_name = form.title
        c.content = form.content
        c.rating = rating

        character.edit(self.user_id, c, friends_only=form.friends)
        raise web.seeother("/character/%i/%s%s" % (define.get_int(form.charid),
                                                   slug_for(form.title),
                                                   ("?anyway=true" if self.user_id in staff.MODS else '')))