|
|
@ -54,6 +54,15 @@ def insert_page():
|
|
|
|
#跳转至添加信息页面
|
|
|
|
#跳转至添加信息页面
|
|
|
|
return render_template("insert.html")
|
|
|
|
return render_template("insert.html")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@app.route("/delete/<c_id>")
|
|
|
|
|
|
|
|
def delete_url(c_id):
|
|
|
|
|
|
|
|
c_id = int(c_id) # 获取ID
|
|
|
|
|
|
|
|
city = City.query.get(c_id) # 查找数据对象
|
|
|
|
|
|
|
|
db.session.delete(city) # 删除对象
|
|
|
|
|
|
|
|
db.session.commit() # 提交修改
|
|
|
|
|
|
|
|
return redirect('/')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@app.route("/insert",methods=['GET','POST'])
|
|
|
|
@app.route("/insert",methods=['GET','POST'])
|
|
|
|
def insert():
|
|
|
|
def insert():
|
|
|
|
if request.method == 'POST':
|
|
|
|
if request.method == 'POST':
|
|
|
|