def POST(self): i = web.input() action = i.action if action == "add": name = i.name model.add_topic(name) elif action == "delete": id = i.id model.delete_topic(id) elif action == "rename": id = i.id name = i.name print id, name model.rename_topic(id, name)
def topic(): if not is_admin(): return 'login_fail' action = request.form['action'] if action == 'add': name = request.form['name'] model.add_topic(name) elif action == 'delete': id = request.form['id'] model.delete_topic(id) elif action == 'rename': id = request.form['id'] name = request.form['name'] model.rename_topic(id, name) return ''
def topic(): if not is_admin(): return "login_fail" action = request.form["action"] if action == "add": name = request.form["name"] model.add_topic(name) elif action == "delete": id = request.form["id"] model.delete_topic(id) elif action == "rename": id = request.form["id"] name = request.form["name"] model.rename_topic(id, name) return ""