예제 #1
0
파일: admin.py 프로젝트: orestv/pytester
 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)
예제 #2
0
파일: flaskr.py 프로젝트: orestv/pytester
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 ''
예제 #3
0
파일: flaskr.py 프로젝트: orestv/pytester
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 ""