本文整理汇总了Python中rules.Rules.delete_rule方法的典型用法代码示例。如果您正苦于以下问题:Python Rules.delete_rule方法的具体用法?Python Rules.delete_rule怎么用?Python Rules.delete_rule使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类rules.Rules
的用法示例。
在下文中一共展示了Rules.delete_rule方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: rules_page
# 需要导入模块: from rules import Rules [as 别名]
# 或者: from rules.Rules import delete_rule [as 别名]
def rules_page(key = None):
page = Rules(dsn = app.config['dsn'])
if key == 1:
return page.open_page("piece_name")
elif key == 2:
return page.open_page("piece_move")
elif key == 3:
return page.open_page("special_move")
elif key == 4:
return page.open_page("the_rule")
elif key == 5:
return page.open_page("made_by")
elif key == 6:
return page.open_page("date")
elif key == 7:
return page.open_page("name")
elif key == 8:
return page.open_page("capture_direction")
elif key == 9:
return page.open_page("starting_place")
elif key == 10:
return page.open_page("can_start")
elif request.method == 'GET':
try:
return page.open_page()
except:
return page.init_table()
elif 'initializeTable' in request.form:
return page.init_table()
elif 'addpiece' in request.form:
piece_name = request.form['piece_name']
piece_move = request.form['piece_move']
special_move = request.form['special_move']
return page.add_piece(piece_name, piece_move, special_move)
elif 'addcapture' in request.form:
name = request.form['name']
capture_direction = request.form['capture_direction']
starting_place = request.form['starting_place']
can_start = request.form['can_start']
return page.add_capture(name, capture_direction, starting_place, can_start)
elif 'addrule' in request.form:
the_rule = request.form['the_rule']
made_by = request.form['made_by']
date = request.form['date']
return page.add_rule(the_rule, made_by, date)
elif 'deletepiece' in request.form:
piece_name = request.form['piece_name']
piece_move = request.form['piece_move']
return page.delete_piece(piece_name, piece_move)
elif 'deleterule' in request.form:
the_rule = request.form['the_rule']
return page.delete_rule(the_rule)
elif 'deletecapture' in request.form:
name = request.form['name']
return page.delete_capture(name)
elif 'findpiece' in request.form:
piece_name = request.form['piece_name']
piece_move = request.form['piece_move']
return page.find_pieces(piece_name, piece_move)
elif 'findrule' in request.form:
the_rule = request.form['the_rule']
return page.find_rules(the_rule)
elif 'findcapture' in request.form:
name = request.form['name']
return page.find_captures(name)
else:
return redirect(url_for('home_page'))