Exemplo n.º 1
0
 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)
Exemplo n.º 2
0
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 ''
Exemplo n.º 3
0
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 ""