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 '')))
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 '')))
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 '') ))
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 '')))